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, configure Grafana Cloud Asserts notifications.
Create a Request notification
To create a Request notification, complete the following steps:
Sign into Grafana Cloud and click Asserts > Rules > Notify.
Click Request.
Complete the following fields:
Field name Description Job Select a job. The list of jobs is generated from your environment. Assertion Select the assertion that you are notifying on. Request Type Optional. The category or type of notification you are creating. For example: inbound
,client_connections
,logger
, and so on.Request Context Optional. Details about the request. For example: the API path, the operation performed, the method called, and so on. Other Labels Any additional alert labels that you want to match on, for example, asserts_severity="warning"
.For Duration for which the alert condition must be true before the system sends a notification. Receiver The 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 Name Enter a name for the rule. Click Add new.
Create a Resource notification
To create a Resource notification, complete the following steps:
Sign into Grafana Cloud and click Asserts > Rules > Notify.
Click Resource.
Complete the following fields:
Field name Description Assertion Select the assertion that you are notifying on. Resource Type Optional. The category or type of notification you are creating. For example: inbound
,client_connections
,logger
, and so on.Container Optional. The name of the container using the resource. Source The source of the metrics for the resource. This could be any exporter or framework serving up resource metrics. Severity The severity of the threshold, for example warning
orcritical
.Receiver The 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. For Duration for which the alert condition must be true before a notification is sent. Other Labels Any additional alert labels that you want to match on, for example, asserts_env="prod"
.Rule Name Enter a name for the rule. Click Add new.
Create a Health notification
To create a Health notification, complete the following steps:
Sign into Grafana Cloud and click Asserts > Rules > Notify.
Click Health.
Complete the following fields:
Field name Description Group Prometheus rules are organized into rule groups. Rules Select a rule from the rule group. Env Select the environment for which this notification is relevant. Receiver The 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 for Duration for which the alert condition must be true before a notification is sent. Other Labels Any additional alert labels that you want to match on, for example, asserts_severity="warning"
.Rule Name Enter a name for the rule you are creating. Click Add new.