-
Notifications
You must be signed in to change notification settings - Fork 1k
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
alerting: update Slack configuration #1025
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,7 +436,9 @@ token: <secret> | |
|
||
## `<slack_config>` | ||
|
||
Slack notifications are sent via [Slack webhooks](https://api.slack.com/incoming-webhooks). | ||
Slack notifications are sent via [Slack | ||
webhooks](https://api.slack.com/incoming-webhooks). The notification contains | ||
an [attachment](https://api.slack.com/docs/message-attachments). | ||
|
||
```yaml | ||
# Whether or not to notify about resolved alerts. | ||
|
@@ -449,20 +451,49 @@ Slack notifications are sent via [Slack webhooks](https://api.slack.com/incoming | |
channel: <tmpl_string> | ||
|
||
# API request data as defined by the Slack webhook API. | ||
[ color: <tmpl_string> | default = '{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}' ] | ||
[ icon_emoji: <tmpl_string> ] | ||
[ icon_url: <tmpl_string> ] | ||
[ link_names: <boolean> | default = false ] | ||
[ username: <tmpl_string> | default = '{{ template "slack.default.username" . }}' ] | ||
# The following parameters define the attachment. | ||
[ color: <tmpl_string> | default = '{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}' ] | ||
[ title: <tmpl_string> | default = '{{ template "slack.default.title" . }}' ] | ||
[ title_link: <tmpl_string> | default = '{{ template "slack.default.titlelink" . }}' ] | ||
[ icon_emoji: <tmpl_string> ] | ||
[ icon_url: <tmpl_string> ] | ||
[ pretext: <tmpl_string> | default = '{{ template "slack.default.pretext" . }}' ] | ||
[ text: <tmpl_string> | default = '{{ template "slack.default.text" . }}' ] | ||
[ fallback: <tmpl_string> | default = '{{ template "slack.default.fallback" . }}' ] | ||
[ footer: <tmpl_string> | default = '{{ template "slack.default.footer" . }}' ] | ||
fields: | ||
[ <field_config> ... ] | ||
actions: | ||
[ <action_config> ... ] | ||
[ short_fields: <boolean> | default = false ] | ||
|
||
# The HTTP client's configuration. | ||
[ http_config: <http_config> | default = global.http_config ] | ||
``` | ||
|
||
### `<action_config>` | ||
|
||
The fields are documented in the [Slack API documentation](https://api.slack.com/docs/message-attachments#action_fields). | ||
|
||
```yaml | ||
type: <tmpl_string> | ||
text: <tmpl_string> | ||
url: <tmpl_string> | ||
[ style: <tmpl_string> [ default = '' ] | ||
``` | ||
|
||
### `<field_config>` | ||
|
||
The fields are documented in the [Slack API documentation](https://api.slack.com/docs/message-attachments#fields). | ||
|
||
```yaml | ||
title: <tmpl_string> | ||
value: <tmpl_string> | ||
[ short: <boolean> | default = slack_config.short_fields ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. slack_config.actions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I don't get your remark. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You had this at a different indentation previously |
||
``` | ||
|
||
## `<opsgenie_config>` | ||
|
||
OpsGenie notifications are sent via the [OpsGenie API](https://www.opsgenie.com/docs/web-api/alert-api). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this stage we should probably sort alphabetically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better (for now) to keep the parameters that go into the webhook notification separated from the parameters that control the attachment because of the Slack API documentation which keeps them apart.