Skip to content

Add alertmanager config to single process documents #6274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented Oct 16, 2024

#6204 added Alertmanager to all target.

However, single process documents do not contain alertmanager configs, so the Cortex fails to start using these configs.
This PR adds alertmanager configs to single process documents.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@alanprot
Copy link
Member

Thanks!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 17, 2024
alertmanager_storage:
backend: local
local:
# Make sure file exist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we can improve this a bit. Do we require the folder for rules to exist? Or Ruler will try to create it beforehand

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruler checks the rule file as well, but it doesn't abort. However, the alertmanager abort. So, I added the annotations only to the alertmanager.

The alertmanager logs are as follows:

ts=2024-10-18T01:05:01.787107Z caller=cortex.go:450 level=error msg="module failed" module=alertmanager err="invalid service state: Failed, expected: Running, failure: failed to list users with alertmanager configuration: unable to walk file path at /tmp/cortex/alerts: lstat /tmp/cortex/alerts: no such file or directory"

level=error msg="error running cortex" err="failed services\ngithub.com/cortexproject/cortex/pkg/cortex.(*Cortex)

The ruler logs:

ts=2024-10-18T01:07:18.186139Z caller=ruler.go:727 level=error msg="unable to list rules" err="unable to read dir /tmp/cortex/rules: open /tmp/cortex/rules: no such file or directory"

But, it doesn't abort.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks.

@yeya24 yeya24 merged commit e070ec6 into cortexproject:master Oct 19, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants