Menu
Grafana Cloud

Create notifications

To receive alerts when an assertion fires, you can create a notification rule. This rule specifies the conditions for triggering an alert when an assertion fires. Notification rules are useful for customizing when you receive alerts, ensuring you are notified only for specific instances and not every time an assertion occurs.

Asserts uses Prometheus Alertmanager for notifications, which enables you to use the various receivers listed on its official page, such as email, PagerDuty, Slack, and so on.

Notifications are organized into different sections, just like the thresholds, and the same hierarchical granularity levels apply. For example, you can set notifications for an assertion whenever it fires, or when it fires on a specific job or a job and request type. Free-form label conditions are also supported.

Before you begin

Before you create a notifications rule, ensure the following:

Create a Request notification

To create a Request notification, complete the following steps:

  1. Sign into Grafana Cloud and click Asserts > Rules > Notify.

  2. Click Request.

  3. Complete the following fields:

    Field nameDescription
    JobSelect a job. The list of jobs is generated from your environment.
    AssertionSelect the assertion that you are notifying on.
    Request TypeOptional. The category or type of notification you are creating. For example: inbound, client_connections, logger, and so on.
    Request ContextOptional. Details about the request. For example: the API path, the operation performed, the method called, and so on.
    Other LabelsAny additional alert labels that you want to match on, for example, asserts_severity="warning".
    ForDuration for which the alert condition must be true before the system sends a notification.
    ReceiverThe target system that receives the notification, such as Slack, MS Teams, or a pager. You must configure a contact point before you create a notification.
    Rule NameEnter a name for the rule.
  4. Click Add new.

Create a Resource notification

To create a Resource notification, complete the following steps:

  1. Sign into Grafana Cloud and click Asserts > Rules > Notify.

  2. Click Resource.

  3. Complete the following fields:

    Field nameDescription
    AssertionSelect the assertion that you are notifying on.
    Resource TypeOptional. The category or type of notification you are creating. For example: inbound, client_connections, logger, and so on.
    ContainerOptional. The name of the container using the resource.
    SourceThe source of the metrics for the resource. This could be any exporter or framework serving up resource metrics.
    SeverityThe severity of the threshold, for example warning or critical.
    ReceiverThe target system that receives the notification, such as Slack, MS Teams, or a pager. You must configure a contact point before you create a notification.
    ForDuration for which the alert condition must be true before a notification is sent.
    Other LabelsAny additional alert labels that you want to match on, for example, asserts_env="prod".
    Rule NameEnter a name for the rule.
  4. Click Add new.

Create a Health notification

To create a Health notification, complete the following steps:

  1. Sign into Grafana Cloud and click Asserts > Rules > Notify.

  2. Click Health.

  3. Complete the following fields:

    Field nameDescription
    GroupPrometheus rules are organized into rule groups.
    RulesSelect a rule from the rule group.
    EnvSelect the environment for which this notification is relevant.
    ReceiverThe target system that receives the notification, such as Slack, MS Teams, or a pager. You must configure a contact point before you create a notification.
    Continues forDuration for which the alert condition must be true before a notification is sent.
    Other LabelsAny additional alert labels that you want to match on, for example, asserts_severity="warning".
    Rule NameEnter a name for the rule you are creating.
  4. Click Add new.