forked from prometheus/alertmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to set the Slack URL in a file
- Added support for the file in both the global and the lower level - Tried to follow configuration patterns I saw in prometheus - The slack file is read on every request as mentioned in the prometheus issue to enable seamless switches prometheus#2498
- Loading branch information
1 parent
bc7b16d
commit 61b7b7c
Showing
8 changed files
with
149 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
global: | ||
slack_api_url: "http://mysecret.example.com/" | ||
slack_api_url_file: '/global_file' | ||
|
||
route: | ||
receiver: 'slack-notifications' | ||
group_by: [alertname, datacenter, app] | ||
|
||
receivers: | ||
- name: 'slack-notifications' | ||
slack_configs: | ||
- channel: '#alerts1' | ||
text: 'test' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
global: | ||
slack_api_url_file: '/global_file' | ||
|
||
route: | ||
receiver: 'slack-notifications' | ||
group_by: [alertname, datacenter, app] | ||
|
||
receivers: | ||
- name: 'slack-notifications' | ||
slack_configs: | ||
# Use global | ||
- channel: '#alerts1' | ||
text: 'test' | ||
# Override global with other file | ||
- channel: '#alerts2' | ||
text: 'test' | ||
api_url_file: '/override_file' | ||
# Override global with inline URL | ||
- channel: '#alerts3' | ||
text: 'test' | ||
api_url: 'http://mysecret.example.com/' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
route: | ||
receiver: 'slack-notifications' | ||
group_by: [alertname, datacenter, app] | ||
|
||
receivers: | ||
- name: 'slack-notifications' | ||
slack_configs: | ||
- channel: '#alerts' | ||
text: 'test' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters