Slack

Overview

Connect Slack to Datadog to help your team collaborate by:

  • Sharing graphs in private or public Slack channels.
  • Receiving alerts and notifications from Datadog within Slack.
  • Muting triggering monitors and declaring incidents from Slack.

Setup

Installation

Install Datadog for Slack in your Slack workspace:

  1. Navigate to the Slack integration tile under Integrations on the Datadog site. Click the Connect Slack Account button at the bottom of the tile.

  2. Confirm your Slack and Datadog accounts are connected. You may need your Slack workspace admin to approve this change one time.

  3. Specify the channels where you want to receive monitor alerts.

  4. Private channels only: In Slack, navigate to the channel where you want to receive monitor alerts and send /invite @Datadog to the channel.

Datadog for Slack is not available on the US1-FED site. See the Slack Webhook documentation for setting up notifications to Slack on the US1-FED site.

Usage

Use the following command to see the Datadog actions you can take in a Slack channel:

/datadog

You can also use the /dd alias for running all /datadog commands.

Once the app has been installed, you can invite the Slack app to any channel:

/invite @Datadog

View all available commands in Slack using:

/datadog help

Some Datadog links shared in Slack are automatically unfurled to display a preview. Supported links include log events, traces, and dashboard widgets. To share a dashboard widget, copy it to your clipboard by hovering over the widget and pressing CMD + C or CTRL + C, or by clicking the Copy button from the share menu, and pasting the link into Slack.

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 Datadog for Slack, 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.

Sharing dashboard widgets

You can post dashboard widget snapshots to any Slack channel without leaving Slack.

There are two ways you can share a dashboard widget from Slack:

On Demand: Use /datadog dashboard or use /datadog and click the Share Dashboard Widget button.

Workflow Builder: Datadog for Slack provides a Workflow Builder step that allows you to post widget snapshots as part of your Slack automation workflows.

For a list of supported widgets, see Scheduled Reports .

Using Datadog incidents

Declare a new incident from Slack with:

/datadog incident 

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:

/datadog incident update

List all open (active and stable) incidents with:

/datadog incident lists

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.

Slack configuration

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:

  1. Newly declared incidents.
  2. Changes to severity, status transition, and incident commander.
  3. Links to the incident ’s overview page in app.
  4. 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:

  1. Navigate to Incidents Settings.
  2. Locate the Incident Updates Channel section.
  3. Define the Slack workspace and specific Slack channel for your incident updates.
Incident Updates Channel

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 .

Installation

The integration for Slack is installed using its integration tile on the Datadog site.

Configuration

  1. In your Slack account, go to the Datadog (Legacy) app .
  2. Click Install –> Add Integration, then copy the Slack Webhook URL.
  3. Navigate to the Datadog-Slack integration tile in the configuration tab.
  4. Click on Add Account
  5. Add a Slack Account Name of your choice.
  6. Paste the Webhook URL in the Slack Account Hook field.
  7. Click Save.
  8. Add your Slack Channels to post to:
Slack configuration
  1. 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 integration for Slack, 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:

<!subteam^12345>

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 integration for Slack:

  • @slack-{{owner.name}} post a message on the owner’s channel for this monitor.

  • @slack-{{host.name}} post a Slack message to the #host.name channel.

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.

Slack Notifications Config

Data Collected

Metrics

The integration for Slack does not provide any metrics.

Events

The integration for Slack does not include any events.

Service Checks

The integration for Slack 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

ScopesRequest Reason
channels:joinAutomatically join public channels configured in the Slack integration tile in Datadog.
channels:manageCreate channels to manage and remediate incidents using Datadog Incident Management.
channels:readProvides channel name auto-complete suggestions in the Slack integration tile in Datadog.
chat:writeReceive Datadog alerts and notifications in approved channels and conversations.
commandsEnables the /datadog command, and its /dd alias, to perform actions in Datadog.
groups:readProvides channel name auto-complete suggestions for private channels in the Slack integration tile in Datadog.
im:historyAllows Datadog to send messages to you in the Messages tab, for example, onboarding instructions.
im:readEnables the /datadog command, and /dd alias, to perform actions in Datadog from direct messages.
im:writeReceive messages, prompts, and errors from the Datadog bot related to your Datadog account.
links:readUnfurls Datadog links in conversations with additional information like graphs and log samples.
links:writeUnfurls Datadog links in conversations with additional information like graphs and log samples.
mpim:readEnables the /datadog command, and /dd alias, to perform actions in Datadog from group direct messages.
reactions:writeAdds an emoji reaction to messages that have been added to an incident timeline by shortcut.
team:readKeep the Slack integration tile in Datadog up to date with the state of your workspace.
users:readPerform actions from Slack as a Datadog user associating with Datadog account.
users:read.emailAdding messaging and users for incidents created outside of Slack in Datadog.
workflow.steps:executeAutomatically 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.

ScopesRequest Reason
channels:historyAutomatically sync messages from an incident channel to the incident timeline.
groups:writeCreate private channels to manage and remediate incidents using Datadog Incident Management.
pins:writeCreate pins in incident channels for relevant Datadog incident links and resources.
bookmarks:writeBookmark important links in an incident channel during the response process.
bookmarks:readEdit bookmarks for important links when they change.

User Token Scopes

ScopesRequest Reason
identity.basicPerform actions in Datadog from Slack by connecting your Datadog account.

Troubleshooting

Need help? Contact Datadog support .