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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/configuration/single-process-config-blocks-gossip-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,12 @@ ruler_storage:
backend: local
local:
directory: /tmp/cortex/rules

alertmanager:
external_url: http://localhost/alertmanager

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.

path: /tmp/cortex/alerts
9 changes: 9 additions & 0 deletions docs/configuration/single-process-config-blocks-gossip-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ ruler_storage:
backend: local
local:
directory: /tmp/cortex/rules

alertmanager:
external_url: http://localhost/alertmanager

alertmanager_storage:
backend: local
local:
# Make sure file exist
path: /tmp/cortex/alerts
9 changes: 9 additions & 0 deletions docs/configuration/single-process-config-blocks-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,12 @@ ruler_storage:
backend: local
local:
directory: /tmp/cortex/rules

alertmanager:
external_url: http://localhost/alertmanager

alertmanager_storage:
backend: local
local:
# Make sure file exist
path: /tmp/cortex/alerts
9 changes: 9 additions & 0 deletions docs/configuration/single-process-config-blocks-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,12 @@ ruler_storage:
backend: local
local:
directory: /tmp/cortex/rules

alertmanager:
external_url: http://localhost/alertmanager

alertmanager_storage:
backend: local
local:
# Make sure file exist
path: /tmp/cortex/alerts
9 changes: 9 additions & 0 deletions docs/configuration/single-process-config-blocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,12 @@ ruler_storage:
backend: local
local:
directory: /tmp/cortex/rules

alertmanager:
external_url: http://localhost/alertmanager

alertmanager_storage:
backend: local
local:
# Make sure file exist
path: /tmp/cortex/alerts
Loading