Slack Integration

To use Sentry’s Slack integration you’ll need to create a Slack 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.

Copy your Client ID, Client Secret, and Signing Secret and paste them into config.yml.

Copied
slack.client-id: <client id>
slack.client-secret: <client secret>
slack.signing-secret: <signing secret>

NOTE: If you're doing local Sentry development, you should use a tool like Ngrok and add system.url-prefix: "https://<your_subdomain>.ngrok.io" to your ~/.sentry/config.yml, otherwise, installing the Slack APP will complain because the redirect URI points to localhost:8000. Also, install the Slack integration from the ngrok subdomain or it will fail to install.

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

Navigate to Event Subscriptions 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

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, under Features. Here is where you can edit your bot's 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 installing and configuring the Slack integration for your projects to take advantage of multi-channel Alert routing.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").