Setting up Slack alerting from Grafana Cloud
This guide is for sending an alert to a macOS device (Apple Silicon) from a Linux node
Prerequisites
- Grafana Alloy installed in an instance/node
- Grafana Cloud account
- Slack workspace and channel
Instructions
-
Set up Slack Developer Program account to access token that will be used to integrate Slack with Grafana Cloud (assuming you already have a Slack workspace and channels set up)
-
Follow steps 1-2 of Slack's quickstart: Creating an app from app settings. Create an app > From scratch > Enter your App Name > Select your Workspace (in this case Walkable Limited Liability Company) > Create app. In the sidebar within OAuth & Permissions: scroll down to Scopes > select Add an OAuthScope under Bot Token Scopes > add the chat:write scope and accept the channels:read prompt
-
Scroll up to OAuth Tokens and click the Install to Walkable Limited Liability Company button > Review app permissions and Install. Tokens will be generated when install is successful
-
Copy the Bot User OAuth Token; open your Slack workplace > right click channel to receive notifications in > scroll down, copy Channel ID
-
In Grafana Cloud sidebar:
- Alerts & IRM -> Alerting -> Contact points.
- Click + Add contact point.
- Enter a contact point name.
- From the Integration list, select Slack.
- If you are using a Slack API token:
- In the Recipient field, copy in the channel ID.
- In the Token field, copy in the Bot User OAuth Token that starts with “xoxb-”.
-
In the Slack workspace you’re choosing to send the alert to: Three dots in top right corner/breadcrumbs > Open channel details > Integrations tab: Add apps > In the In your workspace area, select the app you created earlier in Slack for Developers
-
Back in Grafana Cloud: click the Test button in the contact point you’re adding to send a test notification. You should get a notification in your Slack channel!
-
Click Save contact point.