Note
These instructions are outdated and describe the flow for what Slack apps calls the “classic apps”. Please follow the updated documentation for how to set up the Slack integration with Slacks new apps.
If you already have the classic app set up, you can continue to use it. It is recommended that if you are using the slack.verification-token
that you switch to using the slack.signing-secret
, but both are valid.
For more information between these two kind of bot apps see the Slack documentation
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.
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 on-premise Sentry instance to your newly created Slack app. Copy your Client ID, Client Secret, and Verification Token to your config.yml
file in your Sentry server.
slack.client-id: <'client id'>
slack.client-secret: <client secret>
slack.verification-token: <verification token>
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 Interactive Components under Features.
Click Enable Interactive Components and you’ll be able to enter your Request URL (this is the location of your on-premise Sentry) and Options Load URL:
Request URL: https://your-sentry-server.com/extensions/slack/action/
Options Load URL: https://your-sentry-server.com/extensions/slack/options-load/
Click Enable Interactive Components and Slack will confirm if the HTTP request to the URL you entered succeeds or fails.
Navigate to OAuth & Permissions to configure the Redirect URLs.
Click Add a new Redirect URL, enter the URL, and click Add. The URL will look like:
https://your-sentry-server.com/extensions/slack/setup/
Click Save URLs.
On the same page under Scopes in the Select Permission Scopes dropdown menu, add:
links:read
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 in the following format: https://your-sentry-server.com/extensions/slack/event/
You’ll see “Verified” when you’ve entered the correct URL.
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)
On the same page under Selected Events, click Add Workspace Event and search for link_shared
:
On the same page under App Unfurl Domains, click Add Domain to enter your domain and click Done.
At the bottom of the page, click Save Changes.
Navigate to Bot Users
Click Add a Bot User and give your sentry app bot a name (this is the name that will be displayed when alerts are triggered)
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.