View and edit alerting rules
This documentation topic is designed for Grafana workspaces that support Grafana version 9.x.
For Grafana workspaces that support Grafana version 10.x, see Working in Grafana version 10.
For Grafana workspaces that support Grafana version 8.x, see Working in Grafana version 8.
The Alerting page lists alerting rules. By default, rules are grouped by types of data sources. The Grafana section lists rules managed by Grafana, and the Cortex/Loki section lists rules for Prometheus compatible data sources. You can view alerting rules for Prometheus compatible data sources but you cannot edit them.
The Mimir/Cortex/Loki rules section lists all rules for Mimir, Cortex, or Loki data sources. Cloud alert rules are also listed in this section.
When managing large volumes of alerts, you can use extended alert rule search capabilities to filter on folders, evaluation groups, and rules. Additionally, you can filter alert rules by their properties like labels, state, type, and health.
Note
You can view query definitions for provisioned alerts, but you cannot edit them. Being able to view them allows you to verify that your queries and rule definitions are correct without going back to your provisioning repository for rule definitions.
View alerting rules
Using Grafana alerts, you can view all of your alerts in one page.
To view alerting details
-
From your Grafana console, in the Grafana menu, choose the Alerting (bell) icon to open the Alerting page. By default, rules are displayed in groups by data source type. You can also view by the current state of each alert (these are described in more detail in the following text).
-
In View as, you can toggle between the group and state views by choosing the option you prefer.
-
Choose the arrow next to a row to view more details for that row. The details for a rule include the rule labels, annotations, data sources, and queries, as well as a list of alert instances resulting from the rule.
Note
For more information about understanding the details of your alerts, see State and health of alerting rules.
Group view
Group view shows Grafana alert rules grouped by folder and Loki or Prometheus
alert rules grouped by namespace
+ group
. This is the
default rule list view, intended for managing rules. You can expand each group
to view a list of rules in this group. Expand a rule further to view its
details. You can also expand action buttons and alerts resulting from the rule
to view their details.
State view
State view shows alert rules grouped by state. Use this view to get an overview of which rules are in what state. Each rule can be expanded to view its details. Action buttons and any alerts generated by this rule, and each alert can be further expanded to view its details.
Filter alerting rules
You can filter the alerting rules that appear on the Alerting page in several ways.
-
You can filter to display the rules that query a specific data source by choosing Select data sources, then selecting a data source to filter to.
-
You can filter by labels by choosing search criteria in Search by label. For example, you could type
environment=production,region=~US|EU,severity!=warning
to filter on production warnings in the US and EU. -
You can filter to display the rules in a specific state by choosing Filter alerts by state, and then selecting the state you want to view.
Edit or delete alerting rules
Grafana managed alerting rules can only be edited or deleted by users with Edit permissions for the folder storing the rules. Alerting rules for an external Mimir or Loki instance can be edited or deleted by users with Editor or Admin roles.
To edit or delete a rule
-
Expand a rule until you can see the rule controls for View, Edit, and Delete.
-
Choose Edit to open the create rule page. Make updates in the same way that you create a rule. For details, see the instructions in Creating Grafana managed alert rules or Creating Grafana Mimir or Loki managed alert rules.
-
Optionally, choose Delete to delete a rule.
Export alert rules
You can export rules to YAML or JSON in the Grafana workspace, by choosing Export. It will give you the option to define a new rule, then export it. You can create a rule using the UI and then export it for use in the provisioning API or terraform scripts.
Note
This is supported in both the Grafana workspace and the provisioning interface.