Slack Integration

Updated version of this post

Create a Slack App

To use Sentry’s new Slack integration you’ll need to create an app in Slack bot app. Navigate to Your Apps and click Create new App.

Create

After naming your app and connecting your workspace, navigate to Basic Information. Here you’ll find your Client ID, Client Secret, and Verification token that lets your app access the Slack API.

Here’s where you’ll connect your self-hosted Sentry instance to your newly created Slack app.

system.admin-email
Declared in config.yml.
Copy your Client ID, Client Secret, and Signing Secret.
Copied
slack.client-id: <client id>
slack.client-secret: <client secret>
slack.signing-secret: <signing secret>

After you update the config.yml you need to restart your Sentry server to continue configuring the Slack app.

Now that you’ve created your app and updated your Sentry config, you can navigate to Interactivity & Shortcuts under Features.

Toggle on Interactivity.

Now you’ll be able to enter your Request URL (this is the location of your self-hosted Sentry) and Options Load URL:

Copied
Request URL: {YOUR_DOMAIN}/extensions/slack/action/
Options Load URL: {YOUR_DOMAIN}/extensions/slack/options-load/

Navigate to OAuth & Permissions to configure the Redirect URLs.

OAuth

Click Add a new Redirect URL, enter the URL, and click Add. Set the URL to:

Copied
{YOUR_DOMAIN}/extensions/slack/setup/

Click Save URLs.

On the same page under Scopes you'll need to add Bot Scopes and User Scopes.

Add the following scopes to Bot Scopes:

  • channels:read
  • chat:write
  • chat:write.customize
  • chat:write.public
  • commands
  • groups:read
  • im:history
  • im:read
  • links:read
  • links:write
  • team:read
  • users:read

Add the following scopes to User Scopes:

  • links:read
  • users:read
  • users:read.email

Click Save Changes.

Note: You have the option to set Restrict API Token Usage on this page if you want to ensure your Slack is the only one talking to your Sentry instance.

Navigate to Event Subscription and toggle “On”. Here you will enter another Request URL: {YOUR_DOMAIN}/extensions/slack/event/

You’ll see “Verified” when you’ve entered the correct URL.

Events

Note: When you enter the Request URL, Slack tries to verify it. The request will fail if you didn’t configure the client keys/secret and restarted Sentry to ensure those config changes were picked up. If it fails to validate, first make sure your Sentry instance is running and Slack can talk to it (Slack doesn’t have an ip range)

Still on the Event Subscription page, go to Subscribe to bot events and add the following bot user events:

  • link_shared
  • message.im

and next go to Subscribe to events on behalf of users and add the following event:

  • link_shared

Lastly, still on that page, go to App Unfurl Domains, click Add Domain to enter your domain and click Done.

At the bottom of the page, click Save Changes.

Navigate to App Home, the first section under Features. Here is where you can edit your bot display name (this is the name that will be displayed when alerts are triggered)

Bot

If you plan on having Slack alerts sent to specific users (@person) in addition to channels, toggle on the Messages Tab under Show Tabs in the App Home page.

Navigate to Slash Commands under Features. Click Create New Command and enter the following values:

SettingValue
Command/sentry
Request URL{YOUR_DOMAIN}extensions/slack/commands/

At the bottom of the page, click Save.

Now you can use Slack with Sentry! See our documentation on configuring the Slack integration for your projects to take advantage of multi-channel Alert routing with the new integration.

You can edit this page on GitHub.