NavigationContentFooter
Jump toSuggest an edit
Was this page helpful?

How to configure alerts for Scaleway resources in Grafana

Reviewed on 12 May 2025Published on 06 November 2023

Cockpit does not support Grafana-managed alerting. It integrates with Grafana to visualize metrics, but alerts are managed through the Scaleway alert manager. You should use Grafana only to define alert rules, not to evaluate or receive alert notifications. Once the conditions of your alert rule are met, the Scaleway alert manager evaluates the rule and sends a notification to the contact points you have configured in the Scaleway console or in Grafana.

This page shows you how to create alert rules in Grafana for monitoring Scaleway resources integrated with Cockpit, such as Instances, Object Storage, and Kubernetes. These alerts rely on Scaleway-provided metrics, which are preconfigured and available in the Metrics browser drop-down when using the Scaleway Metrics data source in the Grafana interface. This page explains how to use the Scaleway Metrics data source, interpret metrics, set alert conditions, and activate alerts.

Before you startLink to this anchor

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
  • Scaleway resources you can monitor
  • Created Grafana credentials with the Editor role
  • Enabled the Scaleway alert manager
  • Created a contact point in the Scaleway console or in Grafana (with the Scaleway Alerting alert manager of the same region as your Scaleway Metrics data source), otherwise alerts will not be delivered

Switch to data source managed alert rulesLink to this anchor

Data source managed alert rules allow you to configure alerts managed by the data source of your choice, instead of using Grafana’s managed alerting system which is not supported by Cockpit.

  1. Log in to Grafana using your credentials.
  2. Click the Toggle menu then click Alerting.
  3. Click Alert rules and + New alert rule.
  4. In the Define query and alert condition section, scroll to the Grafana-managed alert rule information banner and click Switch to data source-managed alert rule. This step is mandatory because Cockpit does not support Grafana’s built-in alerting system, but only alerts configured and evaluated by the data source itself. You are redirected to the alert creation process.

Define your metric and alert conditionsLink to this anchor

Switch between the tabs below to create alerts for a Scaleway Instance, an Object Storage bucket, a Kubernetes cluster pod, or Cockpit logs.

The steps below explain how to create the metric selection and configure an alert condition that triggers when your Instance consumes more than 10% of a single CPU core over the past 5 minutes.

  1. Type a name for your alert. For example, alert-for-high-cpu-usage.
  2. Select the Scaleway Metrics data source.
  3. Click the Metrics browser drop-down.
  4. Select the metric you want to configure an alert for. For example, instance_server_cpu_seconds_total.
    Tip

    The instance_server_cpu_seconds_total metric records how many seconds of CPU time your Instance has used in total. It is helpful to detect unexpected CPU usage spikes.

  5. Select the appropriate labels to filter your metric and target specific resources.
  6. Choose values for your selected labels. The Resulting selector field displays your final query selector.
  7. Click Use query to validate your metric selection.
  8. In the query field next to the Metrics browser button, paste the following query. Make sure that the values for the labels you have selected (for example, resource_id and resource_name) correspond to those of the target resource.
    rate(instance_server_cpu_seconds_total{resource_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",resource_name="name-of-your-resource"}[5m]) > 0.1
  9. In the Set alert evaluation behavior field, specify how long the condition must be true before triggering the alert.
  10. Enter a name in the Namespace and Group fields to categorize and manage your alert, and optionally, add annotations.
  11. Enter a label in the Labels field and a name in the Value field. You can skip this step if you want your alerts to be sent to the contact points you may already have created in the Scaleway console.
    Note

    In Grafana, notifications are sent by matching alerts to notification policies based on labels. This step is about deciding how alerts will reach you or your team (Slack, email, etc.) based on labels you attach to them. Then, you can set up rules that define who receives notifications in the Notification policies page. For example, if an alert has the label team = instances-team, you are telling Grafana to send a notification to the Instances team when your alert alert-for-high-cpu-usage gets triggered. Find out how to configure notification policies in Grafana.

  12. Click Save rule in the top right corner of your screen to save and activate your alert.
  13. Optionally, check that your configuration works by temporarily lowering the threshold. This will trigger the alert and notify your contact point.

You can view your firing alerts in the Alert rules section of your Grafana (Home > Alerting > Alert rules).

Important

You can configure up to a maximum of 10 alerts for the Scaleway Metrics data source.

Tip

Find out how to send Cockpit’s alert notifications to Slack using a webhook URL in our dedicated documentation.

See also
How to add contact pointsHow to access Grafana and preconfigured dashboards
Was this page helpful?
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2025 – Scaleway