Alert rules
An alert rule is a set of evaluation criteria for when an alert rule should fire. An alert rule consists of:
Queries that select the dataset to evaluate.
An alert condition (the threshold) that the query must meet or exceed to trigger the alert instance.
An interval that specifies the frequency of alert rule evaluation and a duration indicating how long the condition must be met to trigger the alert instance.
Other customizable options, including expressions, labels, annotations, error and no data handling, notification routing, and more.
Alert rule types
Grafana Alerting inherits the Prometheus Alerting model for defining alert rules and supports two alert rule types:
Data source-managed alert rules
These alert rules can only query Prometheus-based data sources such as Mimir, Loki, and Prometheus. The rules are stored in the data source.
Grafana Alerting supports this alert rule type for horizontal scalability with these data sources.
Grafana-managed alert rules
The recommended alert rule type in Grafana Alerting.
These alert rules can query a wider range of backend data sources, including multiple data sources in a single alert rule. They support expression-based transformations, advanced alert conditions, images in notifications, handling of error and no data states, and more.
You can find the supported public data sources in the Grafana Plugins directory. For step-by-step instructions, see Configure Grafana-managed alert rules.
Recording rules
Similar to alert rules, recording rules are evaluated periodically. A recording rule pre-computes frequently used or computationally expensive queries, and saves the results as a new time series metric.
The new recording metric can then be used in alert rules and dashboards to optimize their queries. For further details, refer to Create recording rules.