How to Integrate Sentry with Slack
Get Sentry notifications directly in your Slack
With Sentry’s Slack integration, you can be alerted to monitoring errors and performance problems issues immediately right inside your Slack workspace. In this tutorial, we’ll walk you through the process of how to set it up.
What you'll need
- A Slack workspace where you can add apps
- Admin-level access to a Sentry instance
Add Sentry’s Slack Integration to your Workspace
Before continuing with the tutorial, make sure you’re logged into your Slack workspace account in your browser.
Go to your Sentry account’s homepage and select Settings from the side navigation bar.
Select Integrations from the sub-menu.
Select Slack from the integrations list and then click Add Workspace.
You’ll be prompted by Slack to allow Sentry to access your workspace. Click Allow.
Create an Alert in Sentry
To use the new Sentry Slack app, you’ll need to create a new alert or edit an existing one to use Slack as the notification mechanism. You can create alerts in Sentry based on a number of performance and error conditions. In this tutorial, we’ll create an issues-based alert. An issue in Sentry is an error or an exception that happens more than once.
Visit your Sentry project’s homepage and click the Create Alert button at the top left.
Select Issues from the options and click Set Conditions.
The next page is for configuring and setting conditions for the alert. Give the alert a name and select the environment you want this alert rule to apply.
In the WHEN clause of the condition, select “Number of events in an issue is…” and then select “more than {value} in {interval}” and then select the value and interval for the events.
In the THEN clause of the condition, select “Send a Slack notification” and then click Save Rule.
You’ve now created a new alert that will notify you in Slack if the same type of error happens in our Sentry-monitored application five or more times in one minute.
To test this in a development environment, simply send 5 invalid requests to your server and you should see a message like the following in your selected Slack channel.