Skip to content

Commit f701057

Browse files
committed
docs(cpt): add tutorial
1 parent 466f620 commit f701057

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

pages/cockpit/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ meta:
5252
<Grid>
5353

5454
<DefaultCard
55-
title="Using Cockpit with Terraform"
56-
url="/tutorials/use-cockpit-with-terraform/"
55+
title="Configuring Slack for Grafana alerting using a Webhook URL"
56+
url="/tutorials/configure-slack-grafana-alerting/"
5757
label="Read more"
5858
/>
5959
<DefaultCard
97.6 KB
Loading

tutorials/configure-slack-grafana-alerting/index.mdx

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
meta:
3-
title: How to configure Slack for Grafana alerting using a Webhook URL
3+
title: Configuring Slack for Grafana alerting using a Webhook URL
44
description: Learn how to send your Grafana alert notifications to your Slack channels for more efficient monitoring.
55
content:
6-
h1: How to configure Slack for Grafana alerting using a Webhook URL
6+
h1: Configuring Slack for Grafana alerting using a Webhook URL
77
paragraph: Learn how to send your Grafana alert notifications to your Slack channels for more efficient monitoring.
88
categories:
99
- observability
1010
dates:
11-
validation: 2025-02-10
12-
posted: 2025-02-10
11+
validation: 2025-02-11
12+
posted: 2025-02-11
1313
---
1414

15-
This page shows you how to use the Slack `Incoming Webhooks` feature to send your Grafana alert notifications to a Slack channel.
15+
This page shows you how to create a Slack app, create a Slack webhook, create your Slack integration in Grafana using the Scaleway Alerting and the Grafana alert managers, and how to configure notification policies to receive your Grafana alert notifications to your Slack channel.
1616

1717
<Macro id="requirements" />
1818

@@ -24,7 +24,7 @@ This page shows you how to use the Slack `Incoming Webhooks` feature to send you
2424
- [Configured](/cockpit/how-to/configure-alerts-for-scw-resources/) Grafana alerts for your resources
2525
- Created a Slack workspace in which you want to receive the alert notifications
2626

27-
## How to create a Slack app
27+
## Creating a Slack app
2828

2929
1. Refer to the [Slack documentation](https://api.slack.com/messaging/webhooks#create-app) and click **Create your Slack app**. You are redirected to a new page and a pop-up appears prompting you to either create your app **from a manifest** or **from scratch**.
3030
2. Click **From scratch**.
@@ -38,7 +38,7 @@ This page shows you how to use the Slack `Incoming Webhooks` feature to send you
3838
- Add a long description
3939
7. Click **Save Changes** Once you are done configuring your app.
4040

41-
## How to activate incoming webhooks
41+
## Activating incoming Webhooks
4242

4343
1. Click **Incoming Webhooks** under the **Features** section.
4444
2. Click the toggle icon to activate incoming webhooks. The **Webhook URLs for Your Workspace** section displays.
@@ -47,22 +47,26 @@ This page shows you how to use the Slack `Incoming Webhooks` feature to send you
4747
5. Click **Allow**.
4848
6. Click **Copy** under the **Webhook URL** section, as you will need it in the next steps.
4949

50-
## How to create your Slack integration in Grafana
50+
## Creating your Slack integration in Grafana
5151

52-
### With the Scaleway Alerting alert manager
52+
### Using the Scaleway Alerting alert manager
5353

5454
1. [Access](/cockpit/how-to/access-grafana-and-managed-dashboards/) your Grafana dashboard.
5555
2. Click the **Toggle menu** icon next to **Home** in the top left corner of your screen.
5656
3. Click **Alerting**, then click **Contact points**.
5757
4. Choose the **Scaleway Alerting** alert manager in the drop-down next to the **Choose Alertmanager** field.
5858
5. Click **+ Add contact point**.
59-
6. Enter a contact point name.
59+
6. Enter a contact point name. For example, `Slack alerts`.
6060
7. Select **Slack** from the **Integration** drop-down.
6161
8. In the **Channel** field, paste the name of the Slack channel or user to send notifications to.
6262
9. Click **Optional Slack settings** and paste your Slack app Webhook URL in the **Webhook URL** field.
6363
10. Click **Save contact point**.
6464

65-
### With the Grafana alert manager
65+
<Message type="important">
66+
If you have already created contact points, you need to [configure a nested notification policy](#configuring-a-notification-policy) to define which contact point should receive which alert.
67+
</Message>
68+
69+
### Using the Grafana alert manager
6670

6771
1. [Access](/cockpit/how-to/access-grafana-and-managed-dashboards/) your Grafana dashboard.
6872
2. Click the **Toggle menu** icon next to **Home** in the top left corner of your screen.
@@ -77,3 +81,25 @@ This page shows you how to use the Slack `Incoming Webhooks` feature to send you
7781
11. Optionally, click **Test** to send a test notification to the recipient you have configured in step 8.
7882
<Lightbox src="scaleway-slack-alert-test.webp" alt="Grafana test alert notification on Slack" />
7983
12. Click **Save contact point**.
84+
85+
<Message type="important">
86+
If you have already created contact points, you need to [configure a nested notification policy](#configuring-a-notification-policy) to define which contact point should receive which alert.
87+
</Message>
88+
89+
## Configuring a notification policy
90+
91+
If you have created multiple contact points in Grafana, the default contact point will receive alerts by default. To make sure your alerts are sent to the desired contact point, you need to define notification policies.
92+
93+
1. [Access](/cockpit/how-to/access-grafana-and-managed-dashboards/) your Grafana dashboard.
94+
2. Click the **Toggle menu** icon next to **Home** in the top left corner of your screen.
95+
3. Click **Alerting**, then click **Notification policies**.
96+
4. Click **+ New nested policy**.
97+
5. In the **Label** field, enter the label `alertname`.
98+
6. In the **Operator** field, select **Equals**.
99+
7. In the **Value** field, enter the name of an existing alert you want your contact point to be notified for. For example, `alert-for-high-cpu-usage`.
100+
8. Optionally, click **+Add matcher** to add more labels.
101+
9. In the **Contact point** field, select the contact point you have configured for Slack.
102+
10. Click **Save policy**. Your nested policy displays. You should now get notified on Slack.
103+
104+
<Lightbox src="scaleway-slack-alerts-firing.webp" alt="Grafana alert for high CPU usage notification on Slack" />
105+

0 commit comments

Comments
 (0)