Skip to navigationSkip to main contentSkip to footerScaleway DocsAsk our AI
Ask our AI

Sending Cockpit's alert notifications to Slack using a webhook URL

cockpit
alerts
monitoring
notifications
slack

This page shows you how to create a Slack app, a Slack webhook, and your Slack integration using the Scaleway Alerting alert manager, and how to configure notification policies in Grafana to receive your Cockpit alert notifications in your Slack channel.

As we do not support Grafana managed alerts, this documentation only shows you how to send Cockpit alerts to your Slack channel.

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • Created data sources
  • Enabled the alert manager
  • Retrieved your Grafana credentials
  • Configured alerts for your resources (preconfigured or custom)
  • Created a Slack workspace in which you want to receive alert notifications

Creating a Slack app

  1. Refer to the Slack documentation 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.
  2. Click From scratch.
  3. Enter a name for your app. For the purpose of this documentation, we are naming the app Scaleway alerts.
  4. Pick the workspace you want to receive alerts in from the drop-down.
  5. Click Create App to confirm. Your app's Basic information page displays.
  6. Optionally, scroll down to Display information to customize the way your app will display in Slack. For more information, refer to the App Detail Guidelines. For example, you can:
    • Add a short description in the Short description field
    • Add an icon
    • Choose a background color
    • Add a long description that will show up on your app detail page.
  7. Click Save Changes Once you are done configuring your app.

Activating incoming Webhooks

  1. Click Incoming Webhooks under the Features section.
  2. Click the toggle icon to activate incoming webhooks. The Webhook URLs for Your Workspace section displays.
  3. Click Add New Webhook to Workspace. You are prompted to choose a Slack channel in which your Scaleway alerts app will post.
  4. Click the drop-down and select one or all Slack channels.
  5. Click Allow.
  6. Click Copy under the Webhook URL section, as you will need it in the next steps.

Creating your Slack integration in Grafana using the Scaleway Alerting alert manager

  1. Log in to Grafana using your credentials.

  2. Click the Grafana icon in the top left side of your screen to open the menu.

  3. Click the arrow next to Alerting on the left-side menu, then click Contact points.

  4. Choose the Scaleway Alerting alert manager in the drop-down next to the Choose Alertmanager field.

  5. Click + Create contact point.

  6. Enter a contact point name. For example, Slack alerts.

  7. Select Slack from the Integration drop-down.

  8. In the Channel field, paste the name of the Slack channel or user to send notifications to.

  9. Click Optional Slack settings and paste your Slack app Webhook URL in the Webhook URL field.

  10. Click Save contact point.

    Important

    If you have already created contact points, you need to configure a child notification policy to define which contact point should receive which alert.

Configuring a notification policy

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.

  1. Click Alerting, then click Notification policies.

  2. Click + New child policy.

  3. In the Label field, enter the label alertname.

  4. In the Operator field, select Equals.

  5. 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.

  6. Optionally, click +Add matcher to add more labels.

  7. In the Contact point drop-down, select the contact point you have configured for Slack.

  8. Click Save policy. Your nested policy displays. You should now get notified on Slack.

Questions?

Visit our Help Center and find the answers to your most frequent questions.

Visit Help Center
No Results