Slack
Overview
Connect Slack to Datadog to help your team collaborate by:
- Sharing graphs with your colleagues in your team’s private or public channels.
- Receiving alerts and notifications from Datadog within Slack.
- Muting triggering monitors and declaring incidents from Slack within Datadog.
Setup
Installation
If you are using the US1, US3, US5, or EU1 Datadog site, install Datadog for Slack in your Slack workspace:
Navigate to the Slack integration tile under Integrations on the Datadog site. Click the Connect Slack Account button at the bottom of the tile.
Confirm your Slack and Datadog accounts are connected. You may need your Datadog workspace admin to approve this change one time.
The Slack App Directory Slack integration works only if you are using the US1, US3, US5, or EU1 Datadog site. For other regions, see the Slack Webhook documentation.
Usage
Once the app has been installed, you can invite the Slack app to any channel:
View all available commands in Slack using:
`/dd` is an alias for all `/datadog` commands.
You can also copy and paste any widget from Datadog to Slack, using CMD + C
or CTRL + C
, or clicking the expand icon on top of a widget, and clicking Copy. When you paste, a link displays that unfurls as the widget once sent to the channel.
Connecting monitors
You can mute triggering monitors in Slack with the click of a button.
There are two ways you can update your monitors to be sent from the Slack app:
Bulk Update: You can bulk update all of your monitors to be sent from the Slack App, and include the muting buttons by clicking the “Upgrade” button at the top of the configuration for each of your Slack accounts in the integration tile in Datadog.
Manual: If you’d like to test this functionality before rolling it out to all of your teams, you can manually add the channels to the new app account configuration in the Slack integration configuration. You may need to remove duplicate references to the same channels.
Using Datadog incidents
Declare a new incident from the Slack App with:
Anyone in your Slack org can declare an incident, regardless of whether they have access to Datadog.
When a new incident is created, a corresponding Slack channel #incident-(unique number ID)
is created, and a message is sent to the channel telling you the new incident channel to use. The channel topic changes with the incident.
Update the incident state (such as severity) with:
List all open (active and stable) incidents with:
Use the message actions command (three dots you can find after hovering over a message sent in an #incident channel on the far right) to send the message to the Incident App Timeline.
Incident updates channel
Using an incident updates channel provides your team with organization-wide visibility into the status of all incidents directly from your Slack workspace. Select which channel in your workspace to post these updates to, and the channel receives the following posts:
- Newly declared incidents.
- Changes to severity, status transition, and incident commander.
- Links to the incident’s overview page in app.
- Link to join dedicated incident Slack channels.
Once the Slack app has been installed, you can navigate to the Incident Settings page. From this, you can scroll down to the Incident Updates Channel section and begin the set-up flow.
After entering the Slack app, set the channel for your incident updates.
How to set up this channel:
- Navigate to Incidents Settings.
- Locate the Incident Updates Channel section.
- Define the Slack workspace and specific Slack channel for your incident updates.
Manage incident tasks
By using Slack Actions and the /datadog
Slack commands, you are able to create and manage incident tasks directly from Slack. Incident task commands must be used in an incident channel.
Slack Actions:
You can create tasks using Slack Actions by hovering over any message sent in an incident channel. On hover, three dots appear to the right of the message, allowing you to “Add Task to Incident”.
Available commands:
/datadog task
creates a task for the incident. You are provided with a modal to include a description of the task, assign teammates, and set a due date./datadog task list
shows a list of all tasks created for the incident. Use this list to mark tasks as complete or reopen them.
All tasks created can be managed in the Remediation tab under Incident Tasks in the Incidents UI. For more information, see the Incident Management documentation.
Use the Slack Webhook if you are using the US5 or US1-FED Datadog site.
Installation
The Slack integration is installed using its integration tile on the Datadog site.
Configuration
- In your Slack account, go to the Datadog (Legacy) app.
- Click Install –> Add Integration, then copy the Slack Webhook URL.
- Navigate to the Datadog-Slack integration tile in the configuration tab.
- Click on Add Account
- Add a Slack Account Name of your choice.
- Paste the Webhook URL in the Slack Account Hook field.
- Click Save.
- Add your Slack Channels to post to:
- If you would like to be notified for every comment on a graph, tick the check box Transfer all user comments by each channel. If this box is left unchecked, you must use the
@slack-<ACCOUNT_NAME>-<CHANNEL_NAME>
syntax in order for comments to be posted to Slack. You may use @slack-<CHANNEL_NAME>
if you are only using one account or referring to the first account.
You can also configure sending alerts to Slack from monitors and the event stream.
@-mentions
in Slack from monitor alert
After setting up the Slack integration, type @slack
in your notification message to see the available list of channels to send your notification to.
Wrap the @username
in < >
in your monitor’s message template to @-notify the defined user within Slack notifications. For example: @slack-SLACK_CHANNEL <@USERNAME>
, or @slack-SLACK_ACCOUNT-SLACK_CHANNEL <@USERNAME>
.
If you are having trouble pinging someone, use their Slack username
instead of the display name. The username
is located in Slack account settings under Username.
Mention @here or @channel by using <!here>
or <!channel>
, respectively.
For user groups, use <!subteam^GROUP_ID>
. To find the GROUP_ID
, query the usergroups.list
API endpoint of Slack. For example, for a user group with an ID of 12345
you would use the following syntax:
Use the same rules, template variables, tags, and conditionals, as standard Datadog Notifications. For example, this notification pings a subteam in a Slack channel called infrastructure
when renotifying:
CPU usage has exceeded {{warn_threshold}} on {{ @machine_id.name }}.
{{#is_renotify}}
Notifying @slack-infrastructure <!subteam^12345>
{{/is_renotify}}
Trailing special characters in a channel name are unsupported for the Slack @-notifications.
For example, @----critical_alerts
works, but @--critical_alerts--
doesn’t receive any notifications.
Using message template variables to dynamically create @-mentions
Use message template variables within a monitor message to dynamically build @-mentions.
For example, if the rendered variable is set up as a channel in the Slack integration:
Or create an @-mention that goes directly to a specific email:
@team-{{team.name}}@company.com
sends an email right to the team’s mailing list.
Having full control of your Slack notifications content
Monitor alerts in your Slack channel contain several fields:
- The message
- A snapshot (graph) of the query that triggered your monitor
- Related tags
- Who was notified
You can turn each of the fields on or off on the Slack integration tile. For each channel, select the checkbox next to each field you would like to include in the notification. Leave the other checkboxes unchecked.
Data Collected
Metrics
The Slack integration does not provide any metrics.
Events
The Slack integration does not include any events.
Service Checks
The Slack integration does not include any service checks.
Permissions
Datadog for Slack requires the following OAuth Scopes. For more information, see the Slack permission scopes documentation.
Bot Token Scopes
Scopes | Request Reason |
---|
channels:join | Automatically join public channels configured in the Slack integration tile in Datadog. |
channels:manage | Create channels to manage and remediate incidents using Datadog Incident Management. |
channels:read | Provides channel name auto-complete suggestions in the Slack integration tile in Datadog. |
chat:write | Receive Datadog alerts and notifications in approved channels and conversations. |
commands | Enables the /datadog command, and its /dd alias, to perform actions in Datadog. |
groups:read | Provides channel name auto-complete suggestions for private channels in the Slack integration tile in Datadog. |
im:history | Allows Datadog to send messages to you in the Messages tab, for example, onboarding instructions. |
im:read | Enables the /datadog command, and /dd alias, to perform actions in Datadog from direct messages. |
im:write | Receive messages, prompts, and errors from the Datadog bot related to your Datadog account. |
links:read | Unfurls Datadog links in conversations with additional information like graphs and log samples. |
links:write | Unfurls Datadog links in conversations with additional information like graphs and log samples. |
mpim:read | Enables the /datadog command, and /dd alias, to perform actions in Datadog from group direct messages. |
reactions:write | Adds an emoji reaction to messages that have been added to an incident timeline by shortcut. |
team:read | Keep the Slack integration tile in Datadog up to date with the state of your workspace. |
users:read | Provides responses customized to your timezone. |
users:read.email | Adding messaging and users for incidents created outside of Slack in Datadog. |
workflow.steps:execute | Automatically send messages with Datadog dashboard widgets from a Slack Workflow Step. |
Optional Bot Token Scopes
Datadog for Slack offers features that require enabling additional optional Bot Token Scopes. These scopes are added dynamically based on feature enablement and are not added during the initial install.
Scopes | Request Reason |
---|
channels:history | Automatically sync messages from an incident channel to the incident timeline. |
groups:write | Create private channels to manage and remediate incidents using Datadog Incident Management. |
pins:write | Create pins in incident channels for relevant Datadog incident links and resources. |
User Token Scopes
Scopes | Request Reason |
---|
identity.basic | Perform actions in Datadog from Slack by connecting your Datadog account. |
Troubleshooting
Need help? Contact Datadog support.