<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configure alert rules on Grafana Labs</title><link>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/</link><description>Recent content in Configure alert rules on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v11.4/alerting/alerting-rules/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure Grafana-managed alert rules</title><link>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/create-grafana-managed-rule/</link><pubDate>Mon, 16 Mar 2026 22:19:55 +0000</pubDate><guid>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/create-grafana-managed-rule/</guid><content><![CDATA[&lt;h1 id=&#34;configure-grafana-managed-alert-rules&#34;&gt;Configure Grafana-managed alert rules&lt;/h1&gt;
&lt;p&gt;Grafana-managed rules can query data from multiple data sources in a single alert rule. They are the most flexible 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/&#34;&gt;alert rule type&lt;/a&gt;. You can also add expressions to transform your data, set alert conditions, and images in alert notifications.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;In Grafana Cloud, the number of Grafana-managed alert rules you can create depends on your Grafana Cloud plan.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Free Forever plan: You can create up to 100 free alert rules, with each alert rule having a maximum of 1000 alert instances.&lt;/li&gt;
&lt;li&gt;All paid plans (Pro and Advanced): They have a soft limit of 2000 alert rules and support unlimited alert instances. To increase the limit, open a support ticket from the &lt;a href=&#34;/docs/grafana-cloud/account-management/support/&#34;&gt;Cloud portal&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;To create or edit Grafana-managed alert rules, follow the instructions below. For a practical example, check out our &lt;a href=&#34;/tutorials/alerting-get-started/&#34;&gt;tutorial on getting started with Grafana alerting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Verify that the data sources you plan to query in the alert rule are 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/#supported-data-sources&#34;&gt;compatible with Grafana-managed alert rules&lt;/a&gt; and are properly configured.&lt;/p&gt;
&lt;h3 id=&#34;permissions&#34;&gt;Permissions&lt;/h3&gt;
&lt;p&gt;Only users with &lt;strong&gt;Edit&lt;/strong&gt; permissions for the folder storing the rules can edit or delete Grafana-managed alert rules.&lt;/p&gt;


&lt;div data-shared=&#34;alerts/configure-provisioning-before-begin.md&#34;&gt;
            &lt;h3 id=&#34;provisioning&#34;&gt;Provisioning&lt;/h3&gt;
&lt;p&gt;Note that if you delete an alert resource created in the UI, you can no longer retrieve it.&lt;/p&gt;
&lt;p&gt;To backup and manage alert rules, you can 

&lt;a href=&#34;/404/&#34;&gt;provision alerting resources&lt;/a&gt; using options such as configuration files, Terraform, or the Alerting API.&lt;/p&gt;
&lt;/div&gt;

        
&lt;h3 id=&#34;default-vs-advanced-options&#34;&gt;Default vs Advanced options&lt;/h3&gt;
&lt;p&gt;You can use default or advanced options for Grafana-managed alert rule creation. The default options streamline rule creation with a cleaner header and a single query and condition. For more complex rules, use advanced options to add multiple queries and expressions.&lt;/p&gt;
&lt;p&gt;You can toggle between the two options. Once you have created an alert rule, the system defaults to your previous choice for the next alert rule.&lt;/p&gt;
&lt;p&gt;Switching from advanced to default may result in queries and expressions that cannot be converted. In this case, a warning message asks if you want to continue to reset to default settings.&lt;/p&gt;
&lt;p&gt;Default and advanced options are enabled by default for Grafana Cloud users and this feature is being rolled out progressively. OSS users can enable them via the &lt;a href=&#34;/setup-grafana/configure-grafana/feature-toggles/&#34;&gt;&lt;code&gt;alertingQueryAndExpressionsStepMode&lt;/code&gt; feature toggle&lt;/a&gt;.&lt;/p&gt;


&lt;div data-shared=&#34;alerts/configure-alert-rule-name.md&#34;&gt;
            &lt;h2 id=&#34;set-alert-rule-name&#34;&gt;Set alert rule name&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Alerts &amp;amp; IRM&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Alert rules&lt;/strong&gt; -&amp;gt; &lt;strong&gt;&#43; New alert rule&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a name to identify your alert rule.&lt;/p&gt;
&lt;p&gt;This name is displayed in the alert rule list. It is also the &lt;code&gt;alertname&lt;/code&gt; label for every alert instance that is created from this rule.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;define-query-and-condition&#34;&gt;Define query and condition&lt;/h2&gt;
&lt;p&gt;Define a query to get the data you want to measure and a condition that needs to be met before an alert rule fires.&lt;/p&gt;
&lt;p&gt;You can toggle between &lt;strong&gt;Default&lt;/strong&gt; and &lt;strong&gt;Advanced&lt;/strong&gt; options. If the &lt;a href=&#34;#default-vs-advanced-options&#34;&gt;Default vs. Advanced feature&lt;/a&gt; is not enabled in your Grafana instance, follow the &lt;strong&gt;Advanced options&lt;/strong&gt; instructions.&lt;/p&gt;
&lt;div class=&#34;collapse&#34; x-data=&#34;app_collapse()&#34;&gt;
  &lt;button class=&#34;collapse-trigger&#34; @click=&#34;toggle()&#34;&gt;
    &lt;span class=&#34;body-large&#34;&gt;Default options&lt;/span&gt;
    &lt;span class=&#34;collapse-trigger__icon&#34; :class=&#34;{ &#39;collapse-trigger__icon-open&#39; : open }&#34;&gt;
      
  &lt;svg width=&#34;27&#34; height=&#34;26&#34; viewBox=&#34;0 0 27 26&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path opacity=&#34;0.2&#34; d=&#34;M1.73047 12.8359C1.73047 19.4634 7.10305 24.8359 13.7305 24.8359C20.3579 24.8359 25.7305 19.4634 25.7305 12.8359C25.7305 6.20852 20.3579 0.835937 13.7305 0.835937C7.10305 0.835937 1.73047 6.20852 1.73047 12.8359Z&#34; stroke=&#34;black&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;path d=&#34;M18.2344 12.8359L9.23438 12.8359&#34; stroke=&#34;black&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;path d=&#34;M13.7344 8.33594L13.7344 17.3359&#34; stroke=&#34;black&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;/svg&gt;


    &lt;/span&gt;
  &lt;/button&gt;
  &lt;div class=&#34;collapse-content&#34; x-ref=&#34;content&#34; hidden=&#34;until-found&#34;&gt;
    &lt;div class=&#34;collapse-content__inner&#34; x-ref=&#34;content-inner&#34;&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add a 

&lt;a href=&#34;/404/&#34;&gt;query&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add an 

&lt;a href=&#34;/404/&#34;&gt;alert condition&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;When&lt;/strong&gt; input includes the reducer function and the last input is the threshold.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Preview&lt;/strong&gt; to verify.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&#34;collapse&#34; x-data=&#34;app_collapse()&#34;&gt;
  &lt;button class=&#34;collapse-trigger&#34; @click=&#34;toggle()&#34;&gt;
    &lt;span class=&#34;body-large&#34;&gt;Advanced options&lt;/span&gt;
    &lt;span class=&#34;collapse-trigger__icon&#34; :class=&#34;{ &#39;collapse-trigger__icon-open&#39; : open }&#34;&gt;
      
  &lt;svg width=&#34;27&#34; height=&#34;26&#34; viewBox=&#34;0 0 27 26&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;
&lt;path opacity=&#34;0.2&#34; d=&#34;M1.73047 12.8359C1.73047 19.4634 7.10305 24.8359 13.7305 24.8359C20.3579 24.8359 25.7305 19.4634 25.7305 12.8359C25.7305 6.20852 20.3579 0.835937 13.7305 0.835937C7.10305 0.835937 1.73047 6.20852 1.73047 12.8359Z&#34; stroke=&#34;black&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;path d=&#34;M18.2344 12.8359L9.23438 12.8359&#34; stroke=&#34;black&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;path d=&#34;M13.7344 8.33594L13.7344 17.3359&#34; stroke=&#34;black&#34; stroke-width=&#34;1.5&#34; stroke-linecap=&#34;round&#34; stroke-linejoin=&#34;round&#34;/&gt;
&lt;/svg&gt;


    &lt;/span&gt;
  &lt;/button&gt;
  &lt;div class=&#34;collapse-content&#34; x-ref=&#34;content&#34; hidden=&#34;until-found&#34;&gt;
    &lt;div class=&#34;collapse-content__inner&#34; x-ref=&#34;content-inner&#34;&gt;&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the &lt;strong&gt;Options&lt;/strong&gt; dropdown, specify a 

&lt;a href=&#34;/404/&#34;&gt;time range&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Note that Grafana Alerting only supports fixed relative time ranges, for example, &lt;code&gt;now-24hr: now&lt;/code&gt;. It does not support absolute time ranges: &lt;code&gt;2021-12-02 00:00:00 to 2021-12-05 23:59:592&lt;/code&gt; or semi-relative time ranges: &lt;code&gt;now/d to: now&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add a query.&lt;/p&gt;
&lt;p&gt;To add multiple 

&lt;a href=&#34;/404/&#34;&gt;queries&lt;/a&gt;, click &lt;strong&gt;Add query&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;All alert rules are managed by Grafana by default. If you want to switch to a data source-managed alert rule, click &lt;strong&gt;Switch to data source-managed alert rule&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add one or more 

&lt;a href=&#34;/404/&#34;&gt;expressions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;a. For each expression, select either &lt;strong&gt;Classic condition&lt;/strong&gt; to create a single alert rule, or choose from the &lt;strong&gt;Math&lt;/strong&gt;, &lt;strong&gt;Reduce&lt;/strong&gt;, and &lt;strong&gt;Resample&lt;/strong&gt; options to generate separate alert for each series.&lt;/p&gt;
&lt;p&gt;When using Prometheus, you can use an instant vector and built-in functions, so you don&amp;rsquo;t need to add additional expressions.&lt;/p&gt;
&lt;p&gt;b. Click &lt;strong&gt;Preview&lt;/strong&gt; to verify that the expression is successful.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To add a recovery threshold, turn the &lt;strong&gt;Custom recovery threshold&lt;/strong&gt; toggle on and fill in a value for when your alert rule should stop firing.&lt;/p&gt;
&lt;p&gt;You can only add one recovery threshold in a query and it must be the alert condition.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Set as alert condition&lt;/strong&gt; on the query or expression you want to set as your 

&lt;a href=&#34;/404/&#34;&gt;alert condition&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;h2 id=&#34;set-folder-and-labels&#34;&gt;Set folder and labels&lt;/h2&gt;
&lt;p&gt;Organize your alert rule with a folder and set of labels.&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;Labels&lt;/strong&gt; section, you can optionally choose whether to add labels to organize your alert rules and their notifications. For more details, refer to 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/annotation-label/#labels&#34;&gt;alert rule labels&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a folder or click &lt;strong&gt;&#43; New folder&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add labels, if required.&lt;/p&gt;
&lt;p&gt;Add custom labels by selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-alert-evaluation-behavior&#34;&gt;Configure alert evaluation behavior&lt;/h2&gt;
&lt;p&gt;Use 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rule-evaluation/&#34;&gt;alert rule evaluation&lt;/a&gt; to determine how frequently an alert rule should be evaluated and how quickly it should change its state.&lt;/p&gt;
&lt;p&gt;To do this, you need to make sure that your alert rule is in the right evaluation group and set a pending period time that works best for your use case.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a folder or click &lt;strong&gt;&#43; New folder&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select an evaluation group or click &lt;strong&gt;&#43; New evaluation group&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you are creating a new evaluation group, specify the interval for the group.&lt;/p&gt;
&lt;p&gt;All rules within the same group are evaluated concurrently over the same time interval.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rule-evaluation/#pending-period&#34;&gt;pending period&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The pending period is the period in which an alert rule can be in breach of the condition until it fires.&lt;/p&gt;
&lt;p&gt;Once a condition is met, the alert goes into the &lt;strong&gt;Pending&lt;/strong&gt; state. If the condition remains active for the duration specified, the alert transitions to the &lt;strong&gt;Firing&lt;/strong&gt; state, else it reverts to the &lt;strong&gt;Normal&lt;/strong&gt; state.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Turn on pause alert notifications, if required.&lt;/p&gt;
&lt;p&gt;You can pause alert rule evaluation to prevent noisy alerting while tuning your alerts.
Pausing stops alert rule evaluation and doesn&amp;rsquo;t create any alert instances.
This is different to 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/configure-notifications/mute-timings/&#34;&gt;mute timings&lt;/a&gt;, which stop notifications from being delivered, but still allows for alert rule evaluation and the creation of alert instances.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In &lt;strong&gt;Configure no data and error handling&lt;/strong&gt;, you can define the alerting behavior and alerting state for two scenarios:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the evaluation returns &lt;strong&gt;No data&lt;/strong&gt; or all values are null.&lt;/li&gt;
&lt;li&gt;When the evaluation returns &lt;strong&gt;Error&lt;/strong&gt; or timeout.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;configure-no-data-and-error-handling&#34;&gt;Configure no data and error handling&lt;/h3&gt;

   
   &lt;div data-shared=&#34;alerts/table-configure-no-data-and-error.md&#34;&gt;
               &lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
         &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
       &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
       &lt;table&gt;
         &lt;thead&gt;
             &lt;tr&gt;
                 &lt;th&gt;Configure&lt;/th&gt;
                 &lt;th&gt;Set alert state&lt;/th&gt;
                 &lt;th&gt;Description&lt;/th&gt;
             &lt;/tr&gt;
         &lt;/thead&gt;
         &lt;tbody&gt;
             &lt;tr&gt;
                 &lt;td&gt;No Data&lt;/td&gt;
                 &lt;td&gt;No Data&lt;/td&gt;
                 &lt;td&gt;The default option for &lt;strong&gt;No Data&lt;/strong&gt; events.&lt;br/&gt;Sets alert instance state to &lt;code&gt;No Data&lt;/code&gt;. &lt;br/&gt; The alert rule also creates a new alert instance &lt;code&gt;DatasourceNoData&lt;/code&gt; with the name and UID of the alert rule, and UID of the datasource that returned no data as labels.&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
                 &lt;td&gt;Error&lt;/td&gt;
                 &lt;td&gt;Error&lt;/td&gt;
                 &lt;td&gt;The default option for &lt;strong&gt;Error&lt;/strong&gt; events.&lt;br/&gt;Sets alert instance state to &lt;code&gt;Error&lt;/code&gt;. &lt;br/&gt; The alert rule also creates a new alert instance &lt;code&gt;DatasourceError&lt;/code&gt; with the name and UID of the alert rule, and UID of the datasource that returned no data as labels.&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
                 &lt;td&gt;No Data or Error&lt;/td&gt;
                 &lt;td&gt;Alerting&lt;/td&gt;
                 &lt;td&gt;Sets the alert instance state to &lt;code&gt;Pending&lt;/code&gt; and then transitions to &lt;code&gt;Alerting&lt;/code&gt; once the pending period ends. If you sent the pending period to 0, the alert instance state is immediately set to &lt;code&gt;Alerting&lt;/code&gt;.&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
                 &lt;td&gt;No Data or Error&lt;/td&gt;
                 &lt;td&gt;Normal&lt;/td&gt;
                 &lt;td&gt;Sets alert instance state to &lt;code&gt;Normal&lt;/code&gt;.&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
                 &lt;td&gt;No Data or Error&lt;/td&gt;
                 &lt;td&gt;Keep Last State&lt;/td&gt;
                 &lt;td&gt;Maintains the alert instance in its last state. Useful for mitigating temporary issues.&lt;/td&gt;
             &lt;/tr&gt;
         &lt;/tbody&gt;
       &lt;/table&gt;
     &lt;/div&gt;
   &lt;/section&gt;&lt;/div&gt;
   
           
&lt;p&gt;For more details, refer to 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rule-evaluation/state-and-health/#alert-instance-state&#34;&gt;alert instance states&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rule-evaluation/state-and-health/#modify-the-no-data-or-error-state&#34;&gt;modify the no data or error state&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-labels-and-notifications&#34;&gt;Configure labels and notifications&lt;/h2&gt;
&lt;p&gt;In the &lt;strong&gt;Labels&lt;/strong&gt; section, you can optionally choose whether to add labels to organize your alert rules, make searching easier, as well as set which notification policy should handle your firing alert instance.&lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;Configure notifications&lt;/strong&gt; section, you can choose to select a contact point directly from the alert rule form or choose to use notification policy routing as well as set up mute timings and groupings.&lt;/p&gt;
&lt;p&gt;Complete the following steps to set up labels and notifications.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add labels, if required.&lt;/p&gt;
&lt;p&gt;Add custom labels by selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure who receives a notification when an alert rule fires by either choosing &lt;strong&gt;Select contact point&lt;/strong&gt; or &lt;strong&gt;Use notification policy&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Select contact point&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Choose this option to select an existing 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/notifications/contact-points/&#34;&gt;contact point&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;All notifications for this alert rule are sent to this contact point automatically and notification policies are not used.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can also optionally select a mute timing as well as groupings and timings to define when not to send notifications.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;An auto-generated notification policy is generated. Only admins can view these auto-generated policies from the &lt;strong&gt;Notification policies&lt;/strong&gt; list view. Any changes have to be made in the alert rules form.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Use notification policy&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Choose this option to use the 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/notifications/notification-policies/&#34;&gt;notification policy tree&lt;/a&gt; to direct your notifications.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;All alert rules and instances, irrespective of their labels, match the default notification policy. If there are no nested policies, or no nested policies match the labels in the alert rule or alert instance, then the default notification policy is the matching policy.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Preview your alert instance routing set up.&lt;/p&gt;
&lt;p&gt;Based on the labels added, alert instances are routed to the following notification policies displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Expand each notification policy below to view more details.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;See details&lt;/strong&gt; to view alert routing details and an email preview.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;div data-shared=&#34;alerts/configure-notification-message.md&#34;&gt;
            &lt;h2 id=&#34;configure-notification-message&#34;&gt;Configure notification message&lt;/h2&gt;
&lt;p&gt;Use 

&lt;a href=&#34;/404/&#34;&gt;annotations&lt;/a&gt; to add information to alert messages that can help respond to the alert.&lt;/p&gt;
&lt;p&gt;Annotations are included by default in notification messages, and can use text or 

&lt;a href=&#34;/404/&#34;&gt;templates&lt;/a&gt; to display dynamic data from queries.&lt;/p&gt;
&lt;p&gt;Grafana provides several optional annotations.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a summary.&lt;/p&gt;
&lt;p&gt;Short summary of what happened and why.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a description.&lt;/p&gt;
&lt;p&gt;Description of what the alert rule does.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a Runbook URL.&lt;/p&gt;
&lt;p&gt;Webpage where you keep your runbook for the alert&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a custom annotation.&lt;/p&gt;
&lt;p&gt;Add any additional information that could help address the alert.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: &lt;strong&gt;Link dashboard and panel&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;

&lt;a href=&#34;/404/&#34;&gt;Link the alert rule to a panel&lt;/a&gt; to facilitate alert investigation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save rule&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="configure-grafana-managed-alert-rules">Configure Grafana-managed alert rules&lt;/h1>
&lt;p>Grafana-managed rules can query data from multiple data sources in a single alert rule. They are the most flexible
&lt;a href="/docs/grafana/v11.4/alerting/fundamentals/alert-rules/">alert rule type&lt;/a>. You can also add expressions to transform your data, set alert conditions, and images in alert notifications.&lt;/p></description></item><item><title>Configure data source-managed alert rules</title><link>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/create-data-source-managed-rule/</link><pubDate>Mon, 16 Mar 2026 22:19:55 +0000</pubDate><guid>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/create-data-source-managed-rule/</guid><content><![CDATA[&lt;h1 id=&#34;configure-data-source-managed-alert-rules&#34;&gt;Configure data source-managed alert rules&lt;/h1&gt;
&lt;p&gt;Data source-managed alert rules can only be created using Grafana Mimir or Grafana Loki data sources.&lt;/p&gt;
&lt;p&gt;The rules are stored within the data source. In a distributed architecture, they can scale horizontally to provide high-availability. For more details, refer to 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/&#34;&gt;alert rule types&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We recommend using 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/create-grafana-managed-rule/&#34;&gt;Grafana-managed alert rules&lt;/a&gt; whenever possible and opting for data source-managed alert rules when scaling your alerting setup is necessary.&lt;/p&gt;


&lt;div data-shared=&#34;alerts/note-prometheus-ds-rules.md&#34;&gt;
            &lt;blockquote&gt;
&lt;p&gt;Rules from a Prometheus data source appear in the &lt;strong&gt;Data source-managed&lt;/strong&gt; section of the &lt;strong&gt;Alert rules&lt;/strong&gt; page when 

&lt;a href=&#34;/404/&#34;&gt;Manage alerts via Alerting UI&lt;/a&gt; is enabled.&lt;/p&gt;
&lt;p&gt;However, Grafana can only create and edit data source-managed rules for Mimir and Loki, not for a Prometheus instance.&lt;/p&gt;&lt;/blockquote&gt;
&lt;/div&gt;

        
&lt;p&gt;To create or edit data source-managed alert rules, follow these instructions.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Verify that you have write permission to the Mimir or Loki data source. Otherwise, you cannot create or update data source-managed alert rules.&lt;/p&gt;
&lt;h3 id=&#34;enable-the-ruler-api&#34;&gt;Enable the Ruler API&lt;/h3&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&#34;/docs/mimir/latest/references/http-api/#ruler&#34;&gt;Mimir Ruler API&lt;/a&gt; or &lt;a href=&#34;/docs/loki/latest/api/#ruler&#34;&gt;Loki Ruler API&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mimir&lt;/strong&gt; - use the &lt;code&gt;/prometheus&lt;/code&gt; prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the &lt;a href=&#34;/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend&#34;&gt;Query API&lt;/a&gt; and &lt;a href=&#34;/docs/mimir/latest/operators-guide/reference-http-api/#ruler&#34;&gt;Ruler API&lt;/a&gt; are under the same URL. You cannot provide a separate URL for the Ruler API.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Loki&lt;/strong&gt; - The &lt;code&gt;local&lt;/code&gt; rule storage type, default for the Loki data source, supports only viewing of rules. To edit rules, configure one of the other rule storage types.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;permissions&#34;&gt;Permissions&lt;/h3&gt;
&lt;p&gt;Alert rules for Mimir or Loki instances can be edited or deleted by users with &lt;strong&gt;Editor&lt;/strong&gt; or &lt;strong&gt;Admin&lt;/strong&gt; roles.&lt;/p&gt;
&lt;p&gt;If you do not want to manage alert rules for a particular data source, go to its settings and clear the &lt;strong&gt;Manage alerts via Alerting UI&lt;/strong&gt; checkbox.&lt;/p&gt;


&lt;div data-shared=&#34;alerts/configure-provisioning-before-begin.md&#34;&gt;
            &lt;h3 id=&#34;provisioning&#34;&gt;Provisioning&lt;/h3&gt;
&lt;p&gt;Note that if you delete an alert resource created in the UI, you can no longer retrieve it.&lt;/p&gt;
&lt;p&gt;To backup and manage alert rules, you can 

&lt;a href=&#34;/404/&#34;&gt;provision alerting resources&lt;/a&gt; using options such as configuration files, Terraform, or the Alerting API.&lt;/p&gt;
&lt;/div&gt;

        


&lt;div data-shared=&#34;alerts/configure-alert-rule-name.md&#34;&gt;
            &lt;h2 id=&#34;set-alert-rule-name&#34;&gt;Set alert rule name&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Alerts &amp;amp; IRM&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Alert rules&lt;/strong&gt; -&amp;gt; &lt;strong&gt;&#43; New alert rule&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a name to identify your alert rule.&lt;/p&gt;
&lt;p&gt;This name is displayed in the alert rule list. It is also the &lt;code&gt;alertname&lt;/code&gt; label for every alert instance that is created from this rule.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
&lt;h2 id=&#34;define-query-and-condition&#34;&gt;Define query and condition&lt;/h2&gt;
&lt;p&gt;Define a query to get the data you want to measure and a condition that needs to be met before an alert rule fires.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;By default, new alert rules are Grafana-managed. To switch to &lt;strong&gt;Data source-managed&lt;/strong&gt;, follow these instructions.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a Prometheus-based data source from the drop-down list.&lt;/p&gt;
&lt;p&gt;You can also click &lt;strong&gt;Open advanced data source picker&lt;/strong&gt; to find more options.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a PromQL or LogQL query, including the alert condition.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Rule type&lt;/strong&gt; option, select &lt;strong&gt;Data source-managed&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Preview alerts&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;set-alert-evaluation-behavior&#34;&gt;Set alert evaluation behavior&lt;/h2&gt;
&lt;p&gt;Use 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rule-evaluation/&#34;&gt;alert rule evaluation&lt;/a&gt; to determine how frequently an alert rule should be evaluated and how quickly it should change its state.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select a namespace or click &lt;strong&gt;&#43; New namespace&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select an evaluation group or click &lt;strong&gt;&#43; New evaluation group&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;If you are creating a new evaluation group, specify the interval for the group.&lt;/p&gt;
&lt;p&gt;All rules within the same group are evaluated sequentially over the same time interval. You can reorder them from the &lt;strong&gt;Alert rules&lt;/strong&gt; page.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter a pending period.&lt;/p&gt;
&lt;p&gt;The 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rule-evaluation/#pending-period&#34;&gt;pending period&lt;/a&gt; is the period in which an alert rule can be in breach of the condition until it fires.&lt;/p&gt;
&lt;p&gt;Once a condition is met, the alert goes into the &lt;strong&gt;Pending&lt;/strong&gt; state. If the condition remains active for the duration specified, the alert transitions to the &lt;strong&gt;Firing&lt;/strong&gt; state, else it reverts to the &lt;strong&gt;Normal&lt;/strong&gt; state.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-labels-and-notifications&#34;&gt;Configure labels and notifications&lt;/h2&gt;
&lt;p&gt;Add 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/annotation-label/#labels&#34;&gt;labels&lt;/a&gt; to your alert rules to set which 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/notifications/notification-policies/&#34;&gt;notification policy&lt;/a&gt; should handle your firing alert instances.&lt;/p&gt;
&lt;p&gt;All alert rules and instances, irrespective of their labels, match the default notification policy. If there are no nested policies, or no nested policies match the labels in the alert rule or alert instance, then the default notification policy is the matching policy.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add labels if you want to change the way your notifications are routed.&lt;/p&gt;
&lt;p&gt;Add custom labels by selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;div data-shared=&#34;alerts/configure-notification-message.md&#34;&gt;
            &lt;h2 id=&#34;configure-notification-message&#34;&gt;Configure notification message&lt;/h2&gt;
&lt;p&gt;Use 

&lt;a href=&#34;/404/&#34;&gt;annotations&lt;/a&gt; to add information to alert messages that can help respond to the alert.&lt;/p&gt;
&lt;p&gt;Annotations are included by default in notification messages, and can use text or 

&lt;a href=&#34;/404/&#34;&gt;templates&lt;/a&gt; to display dynamic data from queries.&lt;/p&gt;
&lt;p&gt;Grafana provides several optional annotations.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a summary.&lt;/p&gt;
&lt;p&gt;Short summary of what happened and why.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a description.&lt;/p&gt;
&lt;p&gt;Description of what the alert rule does.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a Runbook URL.&lt;/p&gt;
&lt;p&gt;Webpage where you keep your runbook for the alert&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: Add a custom annotation.&lt;/p&gt;
&lt;p&gt;Add any additional information that could help address the alert.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Optional: &lt;strong&gt;Link dashboard and panel&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;

&lt;a href=&#34;/404/&#34;&gt;Link the alert rule to a panel&lt;/a&gt; to facilitate alert investigation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save rule&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

        
]]></content><description>&lt;h1 id="configure-data-source-managed-alert-rules">Configure data source-managed alert rules&lt;/h1>
&lt;p>Data source-managed alert rules can only be created using Grafana Mimir or Grafana Loki data sources.&lt;/p>
&lt;p>The rules are stored within the data source. In a distributed architecture, they can scale horizontally to provide high-availability. For more details, refer to
&lt;a href="/docs/grafana/v11.4/alerting/fundamentals/alert-rules/">alert rule types&lt;/a>.&lt;/p></description></item><item><title>Create and link alert rules to panels</title><link>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/link-alert-rules-to-panels/</link><pubDate>Mon, 16 Mar 2026 22:19:55 +0000</pubDate><guid>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/link-alert-rules-to-panels/</guid><content><![CDATA[&lt;h1 id=&#34;create-and-link-alert-rules-to-panels&#34;&gt;Create and link alert rules to panels&lt;/h1&gt;
&lt;p&gt;Grafana allows you to link an alert rule to a dashboard panel. This can help you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inform alert responders about where to investigate and which data to examine.&lt;/li&gt;
&lt;li&gt;Visualize the alert state directly from dashboards.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An alert rule is linked to a panel by setting the 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/annotation-label/#annotations&#34;&gt;&lt;code&gt;dashboardUId&lt;/code&gt; and &lt;code&gt;panelId&lt;/code&gt; annotations&lt;/a&gt;. Both annotations must be set together.&lt;/p&gt;
&lt;h2 id=&#34;link-alert-rules-to-panels&#34;&gt;Link alert rules to panels&lt;/h2&gt;
&lt;p&gt;When configuring the alert rule, you can set the dashboard and panel annotations as shown in this &lt;a href=&#34;https://youtu.be/ClLp-iSoaSY?si=qKWnvSVaQuvYcuw9&amp;amp;t=170&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;video&lt;/a&gt;.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Configure the alert rule.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Configure notification message&lt;/strong&gt; section, click &lt;strong&gt;Link dashboard and panel&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select an existing dashboard, then choose a panel from the selected dashboard.&lt;/li&gt;
&lt;li&gt;Complete the alert rule configuration and click &lt;strong&gt;Save rule&lt;/strong&gt; to initiate the alert rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can then 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/monitor-status/view-alert-state/#view-alert-state-on-panels&#34;&gt;view the alert state on the panel&lt;/a&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1200px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/alerting/panel-displays-alert-state.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/alerting/panel-displays-alert-state.png&#34;data-srcset=&#34;/media/docs/alerting/panel-displays-alert-state.png?w=320 320w, /media/docs/alerting/panel-displays-alert-state.png?w=550 550w, /media/docs/alerting/panel-displays-alert-state.png?w=750 750w, /media/docs/alerting/panel-displays-alert-state.png?w=900 900w, /media/docs/alerting/panel-displays-alert-state.png?w=1040 1040w, /media/docs/alerting/panel-displays-alert-state.png?w=1240 1240w, /media/docs/alerting/panel-displays-alert-state.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;A panel displaying the alert status and state changes.&#34;width=&#34;1674&#34;height=&#34;700&#34;title=&#34;A panel displaying the alert status and state changes.&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/panel-displays-alert-state.png&#34;
            alt=&#34;A panel displaying the alert status and state changes.&#34;width=&#34;1674&#34;height=&#34;700&#34;title=&#34;A panel displaying the alert status and state changes.&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;A panel displaying the alert status and state changes.&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;create-alert-rules-from-panels&#34;&gt;Create alert rules from panels&lt;/h2&gt;
&lt;p&gt;To streamline alert creation, you can create an alert rule directly from a panel.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to a dashboard in the &lt;strong&gt;Dashboards&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Hover over the top-right corner of a panel and click the panel menu icon.&lt;/li&gt;
&lt;li&gt;From the dropdown menu, select &lt;strong&gt;More&amp;hellip;&lt;/strong&gt; &amp;gt; &lt;strong&gt;New alert rule&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;This opens the &lt;strong&gt;Edit rule&lt;/strong&gt; form and pre-fills some values:
&lt;ul&gt;
&lt;li&gt;Sets the &lt;code&gt;dashboardUId&lt;/code&gt; and &lt;code&gt;panelId&lt;/code&gt; annotations to the corresponding dashboard and panel.&lt;/li&gt;
&lt;li&gt;Sets the alert rule query using the panel query.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Complete the alert rule configuration and click &lt;strong&gt;Save rule&lt;/strong&gt; to initiate the alert rule.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can then 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/monitor-status/view-alert-state/#view-alert-state-on-panels&#34;&gt;view the alert state on the panel&lt;/a&gt;.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Changes to panel and alert rule queries aren&amp;rsquo;t synchronized. If you change a query, you have to update it in both the panel and the alert rule.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;access-linked-alert-rules-from-panels&#34;&gt;Access linked alert rules from panels&lt;/h2&gt;
&lt;p&gt;This option is available only in 
    &lt;a href=&#34;/docs/grafana/v11.4/panels-visualizations/visualizations/time-series/&#34;&gt;time series panels&lt;/a&gt;. To access alert rules associated to a time series panel, complete the following steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover over the top-right corner of the panel and click the panel menu icon.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;Alert&lt;/strong&gt; tab to view existing alert rules or create a new one.&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="create-and-link-alert-rules-to-panels">Create and link alert rules to panels&lt;/h1>
&lt;p>Grafana allows you to link an alert rule to a dashboard panel. This can help you:&lt;/p>
&lt;ul>
&lt;li>Inform alert responders about where to investigate and which data to examine.&lt;/li>
&lt;li>Visualize the alert state directly from dashboards.&lt;/li>
&lt;/ul>
&lt;p>An alert rule is linked to a panel by setting the
&lt;a href="/docs/grafana/v11.4/alerting/fundamentals/alert-rules/annotation-label/#annotations">&lt;code>dashboardUId&lt;/code> and &lt;code>panelId&lt;/code> annotations&lt;/a>. Both annotations must be set together.&lt;/p></description></item><item><title>Create recording rules</title><link>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/create-recording-rules/</link><pubDate>Mon, 16 Mar 2026 22:19:55 +0000</pubDate><guid>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/create-recording-rules/</guid><content><![CDATA[&lt;h1 id=&#34;configure-recording-rules&#34;&gt;Configure recording rules&lt;/h1&gt;
&lt;p&gt;Recording rules allows you to periodically pre-compute frequently used or computationally expensive queries, saving the results as a new time series metric.&lt;/p&gt;
&lt;p&gt;For instance, you can create a recording rule generating a new metric, &lt;code&gt;error_9001_count&lt;/code&gt;, which counts occurrences of a specific log error within one minute. Then, query the &lt;code&gt;error_9001_count&lt;/code&gt; metric in dashboards and alert rules.&lt;/p&gt;
&lt;p&gt;Recording rules can be helpful in various scenarios, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Faster queries&lt;/strong&gt; are needed: Performing heavy aggregations or querying large data sets is quicker with precomputed results than real-time queries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reducing system load:&lt;/strong&gt; Precomputing specific queries in advance can reduce system overload caused by multiple simultaneous queries.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simplifying complex aggregations:&lt;/strong&gt; Create a new metric from complex aggregations to facilitate alert and dashboard setup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reusing queries across alerts:&lt;/strong&gt; Improve efficiency by reusing the same query across similar alert rules and dashboards.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The evaluation group of the recording rule determines how often the metric is pre-computed.&lt;/p&gt;
&lt;p&gt;Similar to alert rules, Grafana supports two types of recording rules:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/&#34;&gt;Grafana-managed recording rules&lt;/a&gt;, which can query any Grafana data source supported by alerting.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/create-recording-rules/create-data-source-managed-recording-rules/&#34;&gt;Data source-managed recording rules&lt;/a&gt;, which can query Prometheus-based data sources like Mimir or Loki.&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="configure-recording-rules">Configure recording rules&lt;/h1>
&lt;p>Recording rules allows you to periodically pre-compute frequently used or computationally expensive queries, saving the results as a new time series metric.&lt;/p></description></item><item><title>Template annotations and labels</title><link>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/templates/</link><pubDate>Mon, 16 Mar 2026 22:19:55 +0000</pubDate><guid>https://grafana.com/docs/grafana/v11.4/alerting/alerting-rules/templates/</guid><content><![CDATA[&lt;h1 id=&#34;template-annotations-and-labels&#34;&gt;Template annotations and labels&lt;/h1&gt;
&lt;p&gt;You can use templates to customize alert and notification messages, including dynamic data from alert rule queries.&lt;/p&gt;
&lt;p&gt;In Grafana Alerting, you can template alert messages in two ways.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Template annotations and labels&lt;/strong&gt;: In the alert rule definition, you can template annotations and labels to include extra information from query data to the alert, adding meaningful details based on the query results.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Template notifications&lt;/strong&gt;: You can template notifications to control the content and appearance of your notifications.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;how-templating-works&#34;&gt;How templating works&lt;/h2&gt;
&lt;p&gt;In this diagram, you can see the differences between both types of templates.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1200px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/alerting/how-notification-templates-works.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/alerting/how-notification-templates-works.png&#34;data-srcset=&#34;/media/docs/alerting/how-notification-templates-works.png?w=320 320w, /media/docs/alerting/how-notification-templates-works.png?w=550 550w, /media/docs/alerting/how-notification-templates-works.png?w=750 750w, /media/docs/alerting/how-notification-templates-works.png?w=900 900w, /media/docs/alerting/how-notification-templates-works.png?w=1040 1040w, /media/docs/alerting/how-notification-templates-works.png?w=1240 1240w, /media/docs/alerting/how-notification-templates-works.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;How templating works&#34;width=&#34;1072&#34;height=&#34;699&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/how-notification-templates-works.png&#34;
            alt=&#34;How templating works&#34;width=&#34;1072&#34;height=&#34;699&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Refer to 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/templates/&#34;&gt;Templates Introduction&lt;/a&gt; for a more detailed explanation of this diagram.&lt;/p&gt;
&lt;p&gt;Both types of templates are written in the Go templating system. However, it&amp;rsquo;s important to understand that variables and functions used in notification templates are different from those used in annotation and label templates.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Template annotations and labels&lt;/strong&gt;: These templates add extra information to individual alert instances. Template variables like 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/templates/reference/#labels&#34;&gt;&lt;code&gt;$labels&lt;/code&gt;&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/templates/reference/#values&#34;&gt;&lt;code&gt;$values&lt;/code&gt;&lt;/a&gt; represent alert query data of the individual alert instance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Template notifications&lt;/strong&gt;: Notification templates format the notification content for a group of alerts. Variables like 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/configure-notifications/template-notifications/reference/#notification-data&#34;&gt;&lt;code&gt;.Alerts&lt;/code&gt;&lt;/a&gt; include all firing and resolved alerts in the notification.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;template-annotations&#34;&gt;Template annotations&lt;/h2&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/fundamentals/alert-rules/annotation-label/#annotations&#34;&gt;Annotations&lt;/a&gt; add additional information to alert instances and are often used to help identify the alert and guide responders on how to address the issue.&lt;/p&gt;
&lt;p&gt;Annotations are key-value pairs defined in the alert rule. They can contain plain text or template code that is evaluated when the alert fires.&lt;/p&gt;
&lt;p&gt;Grafana includes several optional annotations, such as &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;summary&lt;/code&gt;, &lt;code&gt;runbook_url&lt;/code&gt;, &lt;code&gt;dashboardUId&lt;/code&gt; and &lt;code&gt;panelId&lt;/code&gt;, which can be edited in the alert rule. You can also create your custom annotations. For example, you might create a new annotation named &lt;code&gt;location&lt;/code&gt; to report the location of the system that triggered the alert.&lt;/p&gt;
&lt;p&gt;Here’s an example of a &lt;code&gt;summary&lt;/code&gt; annotation explaining why the alert was triggered, using plain text.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;CPU usage has exceeded 80% for the last 5 minutes.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;However, if you want to display dynamic query values in annotations, you need to use template code. Common use cases include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Displaying the query value that triggered the alert.&lt;/li&gt;
&lt;li&gt;Highlighting label information that identifies the alert, such as the environment, instance, or region.&lt;/li&gt;
&lt;li&gt;Providing specific instructions based on query values.&lt;/li&gt;
&lt;li&gt;Customizing runbook links depending on query labels.&lt;/li&gt;
&lt;li&gt;Including contact information based on query labels.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For instance, you can template the previous example to display the specific instance and CPU value that triggered the alert.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;CPU usage for {{ $labels.instance }} has exceeded 80% ({{ $values.A.Value }}) for the last 5 minutes.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you can use the &lt;code&gt;index&lt;/code&gt; function to print query values.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;CPU usage for {{ index $labels &amp;#34;instance&amp;#34; }} has exceeded 80% ({{ index $values &amp;#34;A&amp;#34; }}) for the last 5 minutes.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The result of the annotation would be as follows.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;CPU usage for Instance 1 has exceeded 80% (81.2345) for the last 5 minutes.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;how-to-template-an-annotation&#34;&gt;How to template an annotation&lt;/h3&gt;
&lt;p&gt;Complete the following steps to template an annotation.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Alerts &amp;amp; IRM&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Alert rules&lt;/strong&gt; -&amp;gt; create or edit an alert rule.&lt;/li&gt;
&lt;li&gt;Scroll down to the &lt;strong&gt;Configure notification message&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Copy in your template in the corresponding annotation field (&lt;code&gt;summary&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;runbook_url&lt;/code&gt;, &lt;code&gt;custom&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;preview-annotation-templates&#34;&gt;Preview annotation templates&lt;/h3&gt;
&lt;p&gt;You can template annotations when creating or editing an alert rule.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1200px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/alerting/alert-rule-using-annotation-template.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/alerting/alert-rule-using-annotation-template.png&#34;data-srcset=&#34;/media/docs/alerting/alert-rule-using-annotation-template.png?w=320 320w, /media/docs/alerting/alert-rule-using-annotation-template.png?w=550 550w, /media/docs/alerting/alert-rule-using-annotation-template.png?w=750 750w, /media/docs/alerting/alert-rule-using-annotation-template.png?w=900 900w, /media/docs/alerting/alert-rule-using-annotation-template.png?w=1040 1040w, /media/docs/alerting/alert-rule-using-annotation-template.png?w=1240 1240w, /media/docs/alerting/alert-rule-using-annotation-template.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;An alert rule templating the annotation summary&#34;width=&#34;900&#34;height=&#34;498&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/alert-rule-using-annotation-template.png&#34;
            alt=&#34;An alert rule templating the annotation summary&#34;width=&#34;900&#34;height=&#34;498&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Two common methods are used to test and preview annotation templates:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Trigger the alert and 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/monitor-status/view-alert-state/&#34;&gt;view the alert instance state in the Grafana UI&lt;/a&gt;, where all annotations of the alert instance are displayed.&lt;/li&gt;
&lt;li&gt;Use a notification template that displays all annotations, then 
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/configure-notifications/template-notifications/manage-notification-templates/#preview-notification-templates&#34;&gt;preview the notification template&lt;/a&gt; using the alert instance.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;template-labels&#34;&gt;Template labels&lt;/h2&gt;
&lt;p&gt;The set of 
    &lt;a href=&#34;/docs/grafana/v11.4/latest/alerting/fundamentals/alert-rules/annotation-label/&#34;&gt;labels&lt;/a&gt; for an alert instance is used to uniquely identify that alert among all other alert instances.&lt;/p&gt;
&lt;p&gt;Labels determine how alerts are routed and managed for notifications, making their design key to the effectiveness of your alerting system.&lt;/p&gt;
&lt;p&gt;Labels can be returned from an alert rule query, such as the &lt;code&gt;pod&lt;/code&gt; label in a Kubernetes Prometheus query. You can also define additional labels in the alert rule to provide extra information for processing alerts.&lt;/p&gt;
&lt;p&gt;Like annotations, labels are key-value pairs that can contain plain text or template code evaluated when the alert fires.&lt;/p&gt;
&lt;p&gt;Template labels when the labels returned by your queries are insufficient. For instance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A new label based on a query value can group a subset of alerts differently, changing how notifications are sent.&lt;/li&gt;
&lt;li&gt;A new label based on a query value can be used in a notification policy to alter the notification contact point.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here’s an example of templating a &lt;code&gt;severity&lt;/code&gt; label based on the query value.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;{{ if (gt $values.A.Value 90.0) -}}
critical
{{ else if (gt $values.A.Value 80.0) -}}
high
{{ else if (gt $values.A.Value 60.0) -}}
medium
{{ else -}}
low
{{- end }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this example, the value of the &lt;code&gt;severity&lt;/code&gt; label is determined by the query value, and the possible options are &lt;code&gt;critical&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, or &lt;code&gt;low&lt;/code&gt;. You can then use the &lt;code&gt;severity&lt;/code&gt; label to change their notifications—for instance, sending &lt;code&gt;critical&lt;/code&gt; alerts immediately or routing &lt;code&gt;low&lt;/code&gt; alerts to a specific team for further review.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;You should avoid displaying query values in labels, as this may create numerous unique alert instances—one for each distinct label value. Instead, use annotations for query values.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;how-to-template-a-label&#34;&gt;How to template a label&lt;/h3&gt;
&lt;p&gt;Complete the following steps to template a label.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Alerts &amp;amp; IRM&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Alert rules&lt;/strong&gt; -&amp;gt; create or edit an alert rule.&lt;/li&gt;
&lt;li&gt;Scroll down to the &lt;strong&gt;Configure labels and notifications&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;&#43; Add labels&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a &lt;strong&gt;key&lt;/strong&gt; that identifies the label.&lt;/li&gt;
&lt;li&gt;Copy in your template in the &lt;strong&gt;value&lt;/strong&gt; field.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;preview-label-templates&#34;&gt;Preview label templates&lt;/h3&gt;
&lt;p&gt;You can template label values when creating or editing an alert rule.&lt;/p&gt;
&lt;p&gt;To preview label values, select &lt;code&gt;Use notification policy&lt;/code&gt;, and then click on &lt;code&gt;Preview routing&lt;/code&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1200px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/media/docs/alerting/alert-instance-routing-preview.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/media/docs/alerting/alert-instance-routing-preview.png&#34;data-srcset=&#34;/media/docs/alerting/alert-instance-routing-preview.png?w=320 320w, /media/docs/alerting/alert-instance-routing-preview.png?w=550 550w, /media/docs/alerting/alert-instance-routing-preview.png?w=750 750w, /media/docs/alerting/alert-instance-routing-preview.png?w=900 900w, /media/docs/alerting/alert-instance-routing-preview.png?w=1040 1040w, /media/docs/alerting/alert-instance-routing-preview.png?w=1240 1240w, /media/docs/alerting/alert-instance-routing-preview.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Routing preview displays label values&#34;width=&#34;2614&#34;height=&#34;1040&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/alert-instance-routing-preview.png&#34;
            alt=&#34;Routing preview displays label values&#34;width=&#34;2614&#34;height=&#34;1040&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;more-information&#34;&gt;More information&lt;/h2&gt;
&lt;p&gt;For further details on how to template alert rules, refer to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/templates/reference/&#34;&gt;Annotation and label template reference&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v11.4/alerting/alerting-rules/templates/examples/&#34;&gt;Annotation and label examples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-tip&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Tip&lt;/p&gt;&lt;p&gt;For a practical example of templating, refer to our &lt;a href=&#34;/tutorials/alerting-get-started-pt4/&#34;&gt;Getting Started with Templating tutorial&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

]]></content><description>&lt;h1 id="template-annotations-and-labels">Template annotations and labels&lt;/h1>
&lt;p>You can use templates to customize alert and notification messages, including dynamic data from alert rule queries.&lt;/p>
&lt;p>In Grafana Alerting, you can template alert messages in two ways.&lt;/p></description></item></channel></rss>