alerting docs: update slack integration
A request was made for full documentation of the Slack app and its configuration options. This PR updates the documentation page with full app configuration documented.
This commit is contained in:
+42
-1
@@ -43,7 +43,7 @@ There are two ways of integrating Slack into Grafana Alerting.
|
||||
|
||||
Note that you can only setup one Slack channel per contact point.
|
||||
|
||||
You can customize the `title` and `body` of the Slack message using [notification templates](ref:notification-templates); however, you cannot modify its visual appearance with custom blocks.
|
||||
You can customize the `title` and `body` of the Slack message using [notification templates](ref:notification-templates); however, you cannot modify its visual appearance with custom blocks. Additional optional settings are available to customize bot appearance, mentions, and message formatting. Refer to the [Optional settings](#optional-settings) section for more details.
|
||||
|
||||
## Before you begin
|
||||
|
||||
@@ -83,6 +83,47 @@ To create your Slack integration in Grafana Alerting, complete the following ste
|
||||
|
||||
1. Click **Save contact point**.
|
||||
|
||||
## Optional settings
|
||||
|
||||
You can configure additional settings to customize your Slack notifications beyond the required fields.
|
||||
|
||||
### Customize bot appearance
|
||||
|
||||
You can customize how the bot appears in Slack channels:
|
||||
|
||||
- **Username**: Override the default bot username that appears in Slack. Set the `username` field to customize the display name.
|
||||
- **Icon emoji**: Provide an emoji to use as the icon for the bot's message. Set the `icon_emoji` field (for example, `:rocket:`). This overrides the icon URL.
|
||||
- **Icon URL**: Provide a URL to an image to use as the icon for the bot's message. Set the `icon_url` field with the image URL.
|
||||
|
||||
### Configure mentions
|
||||
|
||||
You can automatically mention users, groups, or the entire channel when notifications are sent:
|
||||
|
||||
- **Mention users**: Mention one or more specific users in the notification. Set the `mentionUsers` field with a comma-separated list of user IDs (for example, `U024BE7LH,U024BE7LJ`). To find a user's ID, refer to [Slack's documentation on finding member IDs](https://api.slack.com/methods/users.list).
|
||||
|
||||
- **Mention groups**: Mention one or more user groups in the notification. Set the `mentionGroups` field with a comma-separated list of group IDs. You can copy group IDs from the group's Slack profile URL.
|
||||
|
||||
- **Mention channel**: Mention the entire channel or active members. Set the `mentionChannel` field to one of the following:
|
||||
- Empty or omit the field to disable channel mentions
|
||||
- `here` to mention every active channel member
|
||||
- `channel` to mention every channel member
|
||||
|
||||
### Customize message content
|
||||
|
||||
You can customize the notification message using [notification templates](ref:notification-templates):
|
||||
|
||||
- **Title**: Set a custom title for the Slack message. Use the `title` field with template variables (for example, `{{ template "slack.default.title" . }}`).
|
||||
|
||||
- **Text body**: Set a custom body text for the Slack message. Use the `text` field with template variables (for example, `{{ template "slack.default.text" . }}`).
|
||||
|
||||
- **Color**: Set the color of the vertical bar on the left side of the message attachment. Use the `color` field with either:
|
||||
|
||||
### Advanced configuration
|
||||
|
||||
For specialized environments, you can override the default Slack API endpoint:
|
||||
|
||||
- **Endpoint URL**: Specify a custom Slack API endpoint for non-webhook requests. Set the `endpointUrl` field to your custom endpoint. The default is `https://slack.com/api/chat.postMessage`.
|
||||
|
||||
## Next steps
|
||||
|
||||
The Slack contact point is ready to receive alert notifications.
|
||||
|
||||
Reference in New Issue
Block a user