4.2 KiB
aliases, canonical, description, keywords, labels, title, weight, refs
| aliases | canonical | description | keywords | labels | title | weight | refs | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
https://grafana.com/docs/grafana/latest/alerting/alerting-rules/link-alert-rules-to-panels/ | Grafana allows you to link alert rules with panels and dashboards. This helps connect alerts with an existing dashboard and informs alert responders on where to investigate. |
|
|
Create and link alert rules to panels | 300 |
|
Create and link alert rules to panels
Grafana allows you to link an alert rule to a dashboard panel. This can help you:
- Inform alert responders about where to investigate and which data to examine.
- Visualize the alert state directly from dashboards.
An alert rule is linked to a panel by setting the dashboardUId and panelId annotations. Both annotations must be set together.
{{% admonition type="tutorial" %}} For a hands-on example of integrating alert rules with dashboards, check out Part 5 of our Get Started with Grafana Alerting tutorial. {{% /admonition %}}
Link alert rules to panels
When configuring the alert rule, you can set the dashboard and panel annotations as shown in this video.
- Configure the alert rule.
- In the Configure notification message section, click Link dashboard and panel.
- Select an existing dashboard, then choose a panel from the selected dashboard.
- Complete the alert rule configuration and click Save rule to initiate the alert rule.
You can then view the alert state on the panel.
{{< figure src="/media/docs/alerting/panel-displays-alert-state.png" max-width="1200px" caption="A panel displaying the alert status and state changes." >}}
Create alert rules from panels
To streamline alert creation, you can create an alert rule directly from a panel.
- Navigate to a dashboard in the Dashboards section.
- Hover over the top-right corner of a panel and click the panel menu icon.
- From the dropdown menu, select More... > New alert rule.
- This opens the Edit rule form and pre-fills some values:
- Sets the
dashboardUIdandpanelIdannotations to the corresponding dashboard and panel. - Sets the alert rule query using the panel query.
- Sets the
- Complete the alert rule configuration and click Save rule to initiate the alert rule.
You can then view the alert state on the panel.
{{% admonition type="note" %}} Changes to panel and alert rule queries aren't synchronized. If you change a query, you have to update it in both the panel and the alert rule. {{% /admonition %}}
Access linked alert rules from panels
This option is available only in time series panels. To access alert rules associated to a time series panel, complete the following steps.
- Hover over the top-right corner of the panel and click the panel menu icon.
- Click Edit.
- Click the Alert tab to view existing alert rules or create a new one.