diff --git a/pages/cockpit/how-to/configure-alerts-for-scw-resources.mdx b/pages/cockpit/how-to/configure-alerts-for-scw-resources.mdx index db79d0a1f2..2ff4183bcd 100644 --- a/pages/cockpit/how-to/configure-alerts-for-scw-resources.mdx +++ b/pages/cockpit/how-to/configure-alerts-for-scw-resources.mdx @@ -50,3 +50,7 @@ This page shows you how to configure alerts for Scaleway resources in Grafana us You can configure up to a maximum of 10 alerts for the `Scaleway Metrics` data source. + + + Find out how to send Cockpit's alert notifications to Slack using a webkook URL in our [dedicated documentation](/tutorials/configure-slack-alerting/). + \ No newline at end of file diff --git a/pages/cockpit/index.mdx b/pages/cockpit/index.mdx index 34144c0aae..6f8cfff7a2 100644 --- a/pages/cockpit/index.mdx +++ b/pages/cockpit/index.mdx @@ -52,8 +52,8 @@ meta: + + - A Scaleway account logged into the [console](https://console.scaleway.com) + - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization + - [Created](/cockpit/how-to/create-external-data-sources/) data sources + - [Enabled](/cockpit/how-to/enable-alert-manager/) the alert manager + - [Retrieved](/cockpit/how-to/retrieve-grafana-credentials/) your Grafana credentials + - [Configured](/cockpit/how-to/configure-alerts-for-scw-resources/) alerts for your resources (preconfigured or custom) + - [Created](https://slack.com/help/articles/206845317-Create-a-Slack-workspace) a Slack workspace in which you want to receive the alert notifications + +## Creating a Slack app + +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**. +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. You 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]((https://api.slack.com/slack-marketplace/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. [Access](/cockpit/how-to/access-grafana-and-managed-dashboards/) your Grafana dashboard. +2. Click the **Toggle menu** icon next to **Home** in the top left corner of your screen. +3. Click **Alerting**, then click **Contact points**. +4. Choose the **Scaleway Alerting** alert manager in the drop-down next to the **Choose Alertmanager** field. +5. Click **+ Add 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**. + + + 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. + + +## 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. [Access](/cockpit/how-to/access-grafana-and-managed-dashboards/) your Grafana dashboard. +2. Click the **Toggle menu** icon next to **Home** in the top left corner of your screen. +3. Click **Alerting**, then click **Notification policies**. +4. Click **+ New nested policy**. +5. In the **Label** field, enter the label `alertname`. +6. In the **Operator** field, select **Equals**. +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`. +8. Optionally, click **+Add matcher** to add more labels. +9. In the **Contact point** field, select the contact point you have configured for Slack. +10. Click **Save policy**. Your nested policy displays. You should now get notified on Slack. + + +