Create a monitoring integration that posts alert notifications to a Slack channel. You can connect with an Incoming Webhook URL or with a bot token, and you choose one when you create the integration.
| Method | Use when | You need |
|---|---|---|
| Webhook | You want a fast setup for a single channel. | An Incoming Webhook URL. |
| Token | You need several channels or tighter control of the app. | A bot token and a Channel ID. |
The webhook method is the simpler start. Choose the token method for several channels, for control from your own code, or for tighter control over the app’s permissions and the bot’s identity. The steps in Slack follow Slack’s own screens, so they can change. If a screen looks different, check Slack’s documentation.
Before you begin
Section titled “Before you begin”You need a TIR project and a role with Create permission on monitoring integrations. You need a Slack workspace where you can create apps.
Connect with a webhook URL
Section titled “Connect with a webhook URL”Create the Slack side
Section titled “Create the Slack side”- If you need a workspace, go to slack.com/get-started, select
Create a new workspace, enter and verify your email, and name the workspace. Create a channel
for alerts, for example
alerts-test. - Go to api.slack.com/apps and select Create New App, then From
scratch. Name the app, for example
Alert System, pick your workspace, and select Create App. - In the app, open Incoming Webhooks and turn on Activate Incoming Webhooks.
- Select Add New Webhook to Workspace, choose the channel for alerts, and select Allow.
- Copy the URL. It looks like
https://hooks.slack.com/services/T.../B.../.... It is the credential you give TIR.
The URL belongs to the channel you chose. If you create a new URL in Slack, the old one stops working, so paste the new URL into the integration.
Create the integration in TIR
Section titled “Create the integration in TIR”- In Alert Management, select Manage Monitoring Integrations, then Create Monitoring Integration.
- Enter an Integration name and, if you like, a Description.
- Set Contact point type to Slack.
- Under Select Slack Channel, choose Webhook.
- Paste the URL into Webhook URL. It must start with
https://hooks.slack.com/services/. - Select Test URL before you save. A sample message arrives in your channel and TIR reports success. If no message arrives, check that the URL is complete and the channel exists.
- Select Create integration.
Connect with a bot token
Section titled “Connect with a bot token”Create the Slack side
Section titled “Create the Slack side”- Go to api.slack.com/apps and open your app. If you need one, do steps 1 and 2 of the webhook method.
- Open OAuth & Permissions. Under Bot Token Scopes, select Add an OAuth Scope and add
chat:write. Usechat:write, notchat:write.public. The first lets the bot post only in channels it has joined. The second lets it post in every public channel without joining, which is more access than alerts need. - Open Install App and select Allow to install the app in your workspace.
- Copy the Bot User OAuth Token. It starts with
xoxb-. Store it securely: it gives access to your Slack workspace as the bot. - In the Slack channel for alerts, run
/invite @<your app name>, for example/invite @Alert System. The bot posts only in channels it has joined, public or private, so alert messages arrive only after this step. - Open the channel’s name at the top, scroll to the bottom of the details, and copy the Channel
ID. It looks like
C12345678. TIR needs the ID, not the channel name.
Create the integration in TIR
Section titled “Create the integration in TIR”- In Alert Management, select Manage Monitoring Integrations, then Create Monitoring Integration.
- Enter an Integration name and, if you like, a Description.
- Set Contact point type to Slack, and under Select Slack Channel choose Token.
- Enter the Bot token. It must start with
xoxb-. - Enter the Channel ID. It starts with C, G, or D, followed by at least eight capital letters or digits.
- Select Test Token before you save. A sample message arrives in your channel and TIR reports success.
- Select Create integration.
Confirm the integration
Section titled “Confirm the integration”The integration is in Manage Monitoring Integrations. After you create an
alert with it and attach the
alert to a running resource, every notification
for that alert goes to your Slack channel. Each message is titled [FIRING:1] or [RESOLVED:1],
followed by the alert and project names. See What a notification
contains.
TIR reports a Slack error only when you run a test, so a live alert can fail silently. If an alert goes missing, run the test again and see Troubleshooting Slack alerts.