<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Introduction to Grafana Alerting on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/</link><description>Recent content in Introduction to Grafana Alerting on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/alerting/fundamentals/index.xml" rel="self" type="application/rss+xml"/><item><title>Alert rules</title><link>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/alert-rules/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/alert-rules/</guid><content><![CDATA[&lt;h1 id=&#34;alert-rules&#34;&gt;Alert rules&lt;/h1&gt;
&lt;p&gt;An alert rule is a set of evaluation criteria for when an alert rule should fire. An alert rule consists of:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rules/queries-conditions/#data-source-queries&#34;&gt;Queries&lt;/a&gt; that select the dataset to evaluate.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rules/queries-conditions/#alert-condition&#34;&gt;alert condition&lt;/a&gt; (the threshold) that the query must meet or exceed to trigger the alert instance.&lt;/p&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
       style=&#34;max-width: 750px;&#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/alerting-query-conditions-default-options.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/alerting-query-conditions-default-options.png&#34;data-srcset=&#34;/media/docs/alerting/alerting-query-conditions-default-options.png?w=320 320w, /media/docs/alerting/alerting-query-conditions-default-options.png?w=550 550w, /media/docs/alerting/alerting-query-conditions-default-options.png?w=750 750w, /media/docs/alerting/alerting-query-conditions-default-options.png?w=900 900w, /media/docs/alerting/alerting-query-conditions-default-options.png?w=1040 1040w, /media/docs/alerting/alerting-query-conditions-default-options.png?w=1240 1240w, /media/docs/alerting/alerting-query-conditions-default-options.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Alert query using the Prometheus query editor and alert condition&#34;width=&#34;2146&#34;height=&#34;792&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/media/docs/alerting/alerting-query-conditions-default-options.png&#34;
               alt=&#34;Alert query using the Prometheus query editor and alert condition&#34;width=&#34;2146&#34;height=&#34;792&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;An interval that specifies the frequency of 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rules/rule-evaluation/&#34;&gt;alert rule evaluation&lt;/a&gt; and a duration indicating how long the condition must be met to trigger the alert instance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Other customizable options, including expressions, labels, annotations, error and no data handling, notification routing, and more.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;alert-rule-types&#34;&gt;Alert rule types&lt;/h2&gt;
&lt;p&gt;Grafana Alerting inherits the Prometheus Alerting model for defining alert rules and supports two alert rule types:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Data source-managed alert rules&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These alert rules can only query Prometheus-based data sources such as Mimir, Loki, and Prometheus. The rules are stored in the data source.&lt;/p&gt;
&lt;p&gt;Grafana Alerting supports this alert rule type for horizontal scalability with these data sources.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Grafana-managed alert rules&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The recommended alert rule type in Grafana Alerting.&lt;/p&gt;
&lt;p&gt;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 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-data-source-managed-rule/#comparison-with-grafana-managed-rules&#34;&gt;more&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can find the supported public data sources in the &lt;a href=&#34;/grafana/plugins/data-source-plugins/?features=alerting&#34;&gt;Grafana Plugins directory&lt;/a&gt;. For step-by-step instructions, see 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-grafana-managed-rule/&#34;&gt;Configure Grafana-managed alert rules&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;recording-rules&#34;&gt;Recording rules&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;The new recording metric can then be used in alert rules and dashboards to optimize their queries. For further details, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-recording-rules/&#34;&gt;Create recording rules&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="alert-rules">Alert rules&lt;/h1>
&lt;p>An alert rule is a set of evaluation criteria for when an alert rule should fire. An alert rule consists of:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>
&lt;a href="/docs/grafana/v12.4/alerting/fundamentals/alert-rules/queries-conditions/#data-source-queries">Queries&lt;/a> that select the dataset to evaluate.&lt;/p></description></item><item><title>Alert rule evaluation</title><link>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/alert-rule-evaluation/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/alert-rule-evaluation/</guid><content><![CDATA[&lt;h1 id=&#34;alert-rule-evaluation&#34;&gt;Alert rule evaluation&lt;/h1&gt;
&lt;p&gt;The criteria determining when an alert rule fires are based on three settings:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#evaluation-group&#34;&gt;Evaluation group&lt;/a&gt;: how frequently the alert rule is evaluated.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#pending-period&#34;&gt;Pending period&lt;/a&gt;: how long the condition must be met to start firing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#pending-period&#34;&gt;Keep firing for&lt;/a&gt;: how long the alert continues to fire after the condition is no longer met.&lt;/p&gt;
&lt;figure
      class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
      style=&#34;max-width: 750px;&#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/alert-rule-evaluation-2.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/alert-rule-evaluation-2.png&#34;data-srcset=&#34;/media/docs/alerting/alert-rule-evaluation-2.png?w=320 320w, /media/docs/alerting/alert-rule-evaluation-2.png?w=550 550w, /media/docs/alerting/alert-rule-evaluation-2.png?w=750 750w, /media/docs/alerting/alert-rule-evaluation-2.png?w=900 900w, /media/docs/alerting/alert-rule-evaluation-2.png?w=1040 1040w, /media/docs/alerting/alert-rule-evaluation-2.png?w=1240 1240w, /media/docs/alerting/alert-rule-evaluation-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Set the evaluation behavior of the alert rule in Grafana.&#34;width=&#34;1394&#34;height=&#34;922&#34;title=&#34;Set alert rule evaluation&#34;/&gt;
          &lt;noscript&gt;
            &lt;img
              src=&#34;/media/docs/alerting/alert-rule-evaluation-2.png&#34;
              alt=&#34;Set the evaluation behavior of the alert rule in Grafana.&#34;width=&#34;1394&#34;height=&#34;922&#34;title=&#34;Set alert rule evaluation&#34;/&gt;
          &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Set alert rule evaluation&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These settings affect how alert instances progress through their lifecycle.&lt;/p&gt;
&lt;h2 id=&#34;alerting-lifecycle&#34;&gt;Alerting lifecycle&lt;/h2&gt;
&lt;p&gt;Each alert rule can generate one or more alert instances.&lt;/p&gt;
&lt;p&gt;An alert instance transitions between these common states based on how long the alert condition remains met or not met.&lt;/p&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;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;&lt;strong&gt;Normal&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The state of an alert when the condition (threshold) is not met.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Pending&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The state of an alert that has breached the threshold but for less than the &lt;a href=&#34;#pending-period&#34;&gt;pending period&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Alerting&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The state of an alert that has breached the threshold for longer than the &lt;a href=&#34;#pending-period&#34;&gt;pending period&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Recovering&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The state of a firing alert when the threshold is no longer breached, but for less than the &lt;a href=&#34;#keep-firing-for&#34;&gt;keep firing for&lt;/a&gt; period.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 750px;&#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-evaluation-basic-statediagram.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-evaluation-basic-statediagram.png&#34;data-srcset=&#34;/media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=320 320w, /media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=550 550w, /media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=750 750w, /media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=900 900w, /media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=1040 1040w, /media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=1240 1240w, /media/docs/alerting/alert-rule-evaluation-basic-statediagram.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;A diagram of the lifecyle of a firing alert instance.&#34;width=&#34;953&#34;height=&#34;357&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/alert-rule-evaluation-basic-statediagram.png&#34;
            alt=&#34;A diagram of the lifecyle of a firing alert instance.&#34;width=&#34;953&#34;height=&#34;357&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;If an alert rule changes (except for updates to annotations, the evaluation interval, or other internal fields), its alert instances reset to the &lt;strong&gt;Normal&lt;/strong&gt; state, and update accordingly during the next evaluation.&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;To learn about additional alert instance states, see 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rule-evaluation/nodata-and-error-states/&#34;&gt;No Data and Error states&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;notification-routing&#34;&gt;Notification routing&lt;/h2&gt;
&lt;p&gt;Alert instances are routed for 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/notifications/&#34;&gt;notifications&lt;/a&gt; in two scenarios:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;When they transition to the &lt;strong&gt;Alerting&lt;/strong&gt; state.&lt;/li&gt;
&lt;li&gt;When they transition to &lt;strong&gt;Normal&lt;/strong&gt; state and marked as &lt;code&gt;Resolved&lt;/code&gt;, either from the &lt;strong&gt;Alerting&lt;/strong&gt; or &lt;strong&gt;Recovering&lt;/strong&gt; state.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;evaluation-group&#34;&gt;Evaluation group&lt;/h2&gt;
Every alert rule and recording rule is assigned to an evaluation group. Each evaluation group contains an &lt;strong&gt;evaluation interval&lt;/strong&gt; that determines how frequently the rule is checked. For instance, the evaluation may occur every &lt;code&gt;10s&lt;/code&gt;, &lt;code&gt;30s&lt;/code&gt;, &lt;code&gt;1m&lt;/code&gt;, &lt;code&gt;10m&lt;/code&gt;, etc.

&lt;p&gt;Rules can be evaluated concurrently or sequentially. For details, see 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rule-evaluation/evaluation-within-a-group/&#34;&gt;How rules are evaluated within a group&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;pending-period&#34;&gt;Pending period&lt;/h2&gt;
&lt;p&gt;You can set a &lt;strong&gt;Pending period&lt;/strong&gt; to prevent unnecessary notifications caused by temporary issues.&lt;/p&gt;
&lt;p&gt;When the alert condition is met, the alert instance enters the &lt;strong&gt;Pending&lt;/strong&gt; state. It remains in this state until the condition has been continuously true for the entire &lt;strong&gt;Pending period&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This ensures the condition breach is stable before the alert transitions to the &lt;strong&gt;Alerting&lt;/strong&gt; state and routed for notification.&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Normal&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Pending&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Alerting&lt;/strong&gt;&lt;sup&gt;*&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also set the &lt;strong&gt;Pending period&lt;/strong&gt; to zero to skip the &lt;strong&gt;Pending&lt;/strong&gt; state entirely and transition to &lt;strong&gt;Alerting&lt;/strong&gt; immediately.&lt;/p&gt;
&lt;h2 id=&#34;keep-firing-for&#34;&gt;Keep firing for&lt;/h2&gt;
&lt;p&gt;You can set a &lt;strong&gt;Keep firing for&lt;/strong&gt; period to avoid repeated firing-resolving-firing notifications caused by flapping conditions.&lt;/p&gt;
&lt;p&gt;When the alert condition is no longer met during the &lt;strong&gt;Alerting&lt;/strong&gt; state, the alert instance enters the &lt;strong&gt;Recovering&lt;/strong&gt; state.&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Alerting&lt;/strong&gt; → &lt;strong&gt;Recovering&lt;/strong&gt; → &lt;strong&gt;Normal (Resolved)&lt;/strong&gt;&lt;sup&gt;*&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;After the &lt;strong&gt;Keep firing for&lt;/strong&gt; period elapses, the alert transitions to the &lt;strong&gt;Normal&lt;/strong&gt; state and is marked as &lt;strong&gt;Resolved&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If the alert condition is met again, the alert transitions back to the &lt;strong&gt;Alerting&lt;/strong&gt; state, and no new notifications are sent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also set the &lt;strong&gt;Keep firing for&lt;/strong&gt; period to zero to skip the &lt;strong&gt;Recovering&lt;/strong&gt; state entirely.&lt;/p&gt;
&lt;h2 id=&#34;evaluation-example&#34;&gt;Evaluation example&lt;/h2&gt;
&lt;p&gt;Keep in mind:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;One alert rule can generate multiple alert instances—one for each series or dimension produced by the rule&amp;rsquo;s query. Alert instances from the same alert rule may be in different states.&lt;/li&gt;
&lt;li&gt;Only alert instances in the &lt;strong&gt;Alerting&lt;/strong&gt; and &lt;strong&gt;Normal (Resolved)&lt;/strong&gt; state are routed for 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/notifications/&#34;&gt;notifications&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Consider an alert rule with an &lt;strong&gt;evaluation interval&lt;/strong&gt; set at every 30 seconds and a &lt;strong&gt;pending period&lt;/strong&gt; of 90 seconds. The evaluation occurs as follows:&lt;/p&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;Time&lt;/th&gt;
              &lt;th&gt;Condition&lt;/th&gt;
              &lt;th&gt;Alert instance state&lt;/th&gt;
              &lt;th&gt;Pending counter&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;00:30 (first evaluation)&lt;/td&gt;
              &lt;td&gt;Not met&lt;/td&gt;
              &lt;td&gt;Normal&lt;/td&gt;
              &lt;td&gt;-&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;01:00 (second evaluation)&lt;/td&gt;
              &lt;td&gt;Breached&lt;/td&gt;
              &lt;td&gt;Pending&lt;/td&gt;
              &lt;td&gt;0s&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;01:30 (third evaluation)&lt;/td&gt;
              &lt;td&gt;Breached&lt;/td&gt;
              &lt;td&gt;Pending&lt;/td&gt;
              &lt;td&gt;30s&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;02:00 (fourth evaluation)&lt;/td&gt;
              &lt;td&gt;Breached&lt;/td&gt;
              &lt;td&gt;Pending&lt;/td&gt;
              &lt;td&gt;60s&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;02:30 (fifth evaluation)&lt;/td&gt;
              &lt;td&gt;Breached&lt;/td&gt;
              &lt;td&gt;Alerting 📩&lt;/td&gt;
              &lt;td&gt;90s&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;With a &lt;strong&gt;keep firing for&lt;/strong&gt; period of 0 seconds, the alert instance transitions immediately from &lt;strong&gt;Alerting&lt;/strong&gt; to &lt;strong&gt;Normal&lt;/strong&gt;, and marked as &lt;code&gt;Resolved&lt;/code&gt;:&lt;/p&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;Time&lt;/th&gt;
              &lt;th&gt;Condition&lt;/th&gt;
              &lt;th&gt;Alert instance state&lt;/th&gt;
              &lt;th&gt;Pending counter&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;03:00 (sixth evaluation)&lt;/td&gt;
              &lt;td&gt;Not met&lt;/td&gt;
              &lt;td&gt;Normal &lt;sup&gt;Resolved&lt;/sup&gt; 📩&lt;/td&gt;
              &lt;td&gt;120s&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;03:30 (seventh evaluation)&lt;/td&gt;
              &lt;td&gt;Not met&lt;/td&gt;
              &lt;td&gt;Normal&lt;/td&gt;
              &lt;td&gt;150s&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="alert-rule-evaluation">Alert rule evaluation&lt;/h1>
&lt;p>The criteria determining when an alert rule fires are based on three settings:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;a href="#evaluation-group">Evaluation group&lt;/a>: how frequently the alert rule is evaluated.&lt;/p></description></item><item><title>Notifications</title><link>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/notifications/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/notifications/</guid><content><![CDATA[&lt;h1 id=&#34;notifications&#34;&gt;Notifications&lt;/h1&gt;
&lt;p&gt;Choosing how, when, and where to send your alert notifications is an important part of setting up your alerting system. These decisions have a direct impact on your team’s ability to receive the necessary information to resolve issues quickly and minimize alert noise.&lt;/p&gt;
&lt;p&gt;Start defining your 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/notifications/contact-points/&#34;&gt;contact points&lt;/a&gt; to specify how to receive your alert notifications. Then, configure your alert rules to send their alerts to either a contact point or use the &lt;a href=&#34;#notification-policies&#34;&gt;Notification Policy Tree&lt;/a&gt; to flexibly route alerts to contact points.&lt;/p&gt;
&lt;br/&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 750px;&#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/alerting-configure-notifications-v2.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/alerting-configure-notifications-v2.png&#34;data-srcset=&#34;/media/docs/alerting/alerting-configure-notifications-v2.png?w=320 320w, /media/docs/alerting/alerting-configure-notifications-v2.png?w=550 550w, /media/docs/alerting/alerting-configure-notifications-v2.png?w=750 750w, /media/docs/alerting/alerting-configure-notifications-v2.png?w=900 900w, /media/docs/alerting/alerting-configure-notifications-v2.png?w=1040 1040w, /media/docs/alerting/alerting-configure-notifications-v2.png?w=1240 1240w, /media/docs/alerting/alerting-configure-notifications-v2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Configure alert rules to forward firing alerts directly to a contact point or through notification policies&#34;width=&#34;713&#34;height=&#34;224&#34;title=&#34;Configure alert rules to forward firing alerts directly to a contact point or through notification policies&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/alerting-configure-notifications-v2.png&#34;
            alt=&#34;Configure alert rules to forward firing alerts directly to a contact point or through notification policies&#34;width=&#34;713&#34;height=&#34;224&#34;title=&#34;Configure alert rules to forward firing alerts directly to a contact point or through notification policies&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Configure alert rules to forward firing alerts directly to a contact point or through notification policies&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;how-it-works-at-a-glance&#34;&gt;How it works at a glance&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Grafana alerting periodically 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rule-evaluation/&#34;&gt;evaluates your alert rules&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;It triggers notifications for alert instances that are &lt;strong&gt;firing&lt;/strong&gt; or &lt;strong&gt;resolved&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;You can configure an alert rule to send notifications to a &lt;strong&gt;contact point&lt;/strong&gt; or route them through &lt;strong&gt;notification policies&lt;/strong&gt; for greater flexibility.&lt;/li&gt;
&lt;li&gt;To reduce the number of notifications, you can &lt;strong&gt;group related alerts&lt;/strong&gt; into a single notification by using label grouping and notification timings.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;fundamentals&#34;&gt;Fundamentals&lt;/h2&gt;
&lt;h3 id=&#34;contact-points&#34;&gt;Contact points&lt;/h3&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/notifications/contact-points/&#34;&gt;Contact points&lt;/a&gt; contain the configuration for sending alert notifications, specifying destinations like email, Slack, IRM, webhooks, and their notification messages.&lt;/p&gt;
&lt;p&gt;A contact point is a list of integrations, each sending a message to a specific destination.&lt;/p&gt;


&lt;p&gt;By default, notification messages include common alert details, such as the number of alerts, alert names, labels, annotations, and other alert information. You can also customize notification messages and use notification templates.&lt;/p&gt;
&lt;p&gt;First, create the contact point and test the notifications. Then, configure the alert rule to send its notifications to either a contact point or through Notification Policies.&lt;/p&gt;
&lt;h3 id=&#34;notification-policies&#34;&gt;Notification policies&lt;/h3&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/notifications/notification-policies/&#34;&gt;Notification policies&lt;/a&gt; are the backbone of a comprehensive alerting system. They provide a flexible and effective method to route alerts to distinct contact points, helping reduce alert noise while ensuring no alerts are missed.&lt;/p&gt;
&lt;p&gt;The notification policy tree is responsible for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Defining nested policies that can inherit or overwrite parent notification settings.&lt;/li&gt;
&lt;li&gt;Routing alerts by matching alert labels to the appropriate notification policy.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 750px;&#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/notification-routing.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/notification-routing.png&#34;data-srcset=&#34;/media/docs/alerting/notification-routing.png?w=320 320w, /media/docs/alerting/notification-routing.png?w=550 550w, /media/docs/alerting/notification-routing.png?w=750 750w, /media/docs/alerting/notification-routing.png?w=900 900w, /media/docs/alerting/notification-routing.png?w=1040 1040w, /media/docs/alerting/notification-routing.png?w=1240 1240w, /media/docs/alerting/notification-routing.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;A diagram displaying how the notification policy tree routes alerts&#34;width=&#34;1598&#34;height=&#34;968&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/notification-routing.png&#34;
            alt=&#34;A diagram displaying how the notification policy tree routes alerts&#34;width=&#34;1598&#34;height=&#34;968&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Each notification policy handles specific tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Deciding which contact point receives the alert notification.&lt;/li&gt;
&lt;li&gt;Controlling when to send notifications based on its notification timing options.&lt;/li&gt;
&lt;li&gt;Grouping multiple alerts into a single notification to reduce alert noise.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 750px;&#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/alerting-notification-policy-diagram-v5.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/alerting-notification-policy-diagram-v5.png&#34;data-srcset=&#34;/media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=320 320w, /media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=550 550w, /media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=750 750w, /media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=900 900w, /media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=1040 1040w, /media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=1240 1240w, /media/docs/alerting/alerting-notification-policy-diagram-v5.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;A diagram of the notification policy component&#34;width=&#34;1724&#34;height=&#34;464&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/alerting-notification-policy-diagram-v5.png&#34;
            alt=&#34;A diagram of the notification policy component&#34;width=&#34;1724&#34;height=&#34;464&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;group-alert-notifications&#34;&gt;Group alert notifications&lt;/h3&gt;
&lt;p&gt;When something fails in our system, our alerting setup can easily trigger hundreds or even thousands of alert instances (notifications). Several alert rules often fail simultaneously. Additionally, each alert rule may generate multiple alert instances.&lt;/p&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/notifications/group-alert-notifications/&#34;&gt;Grouping alert notifications&lt;/a&gt; is commonly necessary to avoid bombarding our alert inbox. Grouping combines similar alert instances in a given period into one single notification.&lt;/p&gt;
&lt;p&gt;Notification grouping uses:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Labels&lt;/strong&gt;: Group alert instances of the same type by using labels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timing options&lt;/strong&gt;: Wait for a specified period before sending the notification, allowing for the grouping of incoming alert instances.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;templates-silences-and-mute-timings&#34;&gt;Templates, silences and mute timings&lt;/h3&gt;
&lt;p&gt;Grafana Alerting provides advanced notification capabilities that you’ll find useful as you and your team refine your initial alerting system.&lt;/p&gt;
&lt;p&gt;For instance, you can customize notifications with shared 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/templates/&#34;&gt;templates&lt;/a&gt; that provide actionable alert information and can be reused for multiple notifications.&lt;/p&gt;
&lt;p&gt;Additionally, you can use 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/configure-notifications/create-silence/&#34;&gt;silences&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/configure-notifications/mute-timings/&#34;&gt;mute timings&lt;/a&gt; to pause or suppress notifications without interrupting alert evaluation.&lt;/p&gt;
&lt;h2 id=&#34;architecture&#34;&gt;Architecture&lt;/h2&gt;
&lt;p&gt;Grafana Alerting is built on the Prometheus model, which separates two main components for scalability and performance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;An alert generator&lt;/strong&gt; that evaluates alert rules and sends firing and resolved alerts to the alert receiver.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An alert receiver&lt;/strong&gt; (also known as Alertmanager) that receives the alerts and is responsible for sending their notifications.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 750px;&#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/alerting-alertmanager-architecture.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/alerting-alertmanager-architecture.png&#34;data-srcset=&#34;/media/docs/alerting/alerting-alertmanager-architecture.png?w=320 320w, /media/docs/alerting/alerting-alertmanager-architecture.png?w=550 550w, /media/docs/alerting/alerting-alertmanager-architecture.png?w=750 750w, /media/docs/alerting/alerting-alertmanager-architecture.png?w=900 900w, /media/docs/alerting/alerting-alertmanager-architecture.png?w=1040 1040w, /media/docs/alerting/alerting-alertmanager-architecture.png?w=1240 1240w, /media/docs/alerting/alerting-alertmanager-architecture.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;A diagram with the alert generator and alert manager architecture&#34;width=&#34;669&#34;height=&#34;240&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/alerting/alerting-alertmanager-architecture.png&#34;
            alt=&#34;A diagram with the alert generator and alert manager architecture&#34;width=&#34;669&#34;height=&#34;240&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Grafana includes a custom Alertmanager that extends the Prometheus Alertmanager to manage and deliver alert notifications. You can also 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/set-up/configure-alertmanager/&#34;&gt;configure Grafana Alerting to work with other Alertmanagers&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="notifications">Notifications&lt;/h1>
&lt;p>Choosing how, when, and where to send your alert notifications is an important part of setting up your alerting system. These decisions have a direct impact on your team’s ability to receive the necessary information to resolve issues quickly and minimize alert noise.&lt;/p></description></item><item><title>Templates</title><link>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/templates/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/alerting/fundamentals/templates/</guid><content><![CDATA[&lt;h1 id=&#34;templates&#34;&gt;Templates&lt;/h1&gt;
&lt;p&gt;Use templating to customize, format, and reuse alert notification messages. Create more flexible and informative alert notification messages by incorporating dynamic content, such as metric values, labels, and other contextual information.&lt;/p&gt;
&lt;p&gt;In Grafana, you have various options to template your alert notification messages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#template-annotations&#34;&gt;Alert rule annotations&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Annotations add extra information, like &lt;code&gt;summary&lt;/code&gt; and &lt;code&gt;description&lt;/code&gt;, to alert instances for notification messages.&lt;/li&gt;
&lt;li&gt;Template annotations to display query values that are meaningful to the alert, for example, the server name or the threshold query value.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#template-labels&#34;&gt;Alert rule labels&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Labels are used to differentiate an alert instance from all other alert instances.&lt;/li&gt;
&lt;li&gt;Template labels to add an additional label based on a query value, or when the labels from the query are incomplete or not descriptive enough.&lt;/li&gt;
&lt;li&gt;Avoid displaying query values in labels as this can create numerous alert instances—use annotations instead.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#template-notifications&#34;&gt;Notification templates&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Notification templates are used by contact points for consistent messaging in notification titles and descriptions.&lt;/li&gt;
&lt;li&gt;Template notifications when you want to customize the appearance and information of your notifications.&lt;/li&gt;
&lt;li&gt;Avoid using notification templates to add extra information to alert instances—use annotations instead.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&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;

&lt;p&gt;This diagram illustrates the entire templating process, from querying labels and templating the alert summary and notification to the final alert notification message.&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/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 mb-0&#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;title=&#34;How templating works&#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;title=&#34;How templating works&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;How templating works&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;In this diagram:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The alert rule query returns &lt;code&gt;12345&lt;/code&gt;, along with the values of the &lt;code&gt;instance&lt;/code&gt; and &lt;code&gt;job&lt;/code&gt; labels.&lt;/li&gt;
&lt;li&gt;This query result breaches the alert rule condition, firing the alert instance.&lt;/li&gt;
&lt;li&gt;The alert instance generates an annotation summary, defined by the template used in the alert rule summary. In this case, it displays the value of the &lt;code&gt;instance&lt;/code&gt; label: &lt;code&gt;server1&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The Alertmanager receives the firing alert instance, including the final annotation summary, and determines the contact point that will process the alert.&lt;/li&gt;
&lt;li&gt;The Alertmanager uses the contact point&amp;rsquo;s notification template to format the message, then sends the notification to the configured destination(s)—an email address.&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/v12.4/alerting/fundamentals/alert-rules/annotation-label/#annotations&#34;&gt;Annotations&lt;/a&gt; can be defined in the alert rule to add extra information to alert instances.&lt;/p&gt;
&lt;p&gt;When creating an alert rule, Grafana suggests several optional annotations, such as &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;summary&lt;/code&gt;, and &lt;code&gt;runbook_url&lt;/code&gt;, which help identify and respond to alerts. You can also create custom annotations.&lt;/p&gt;
&lt;p&gt;Annotations are key-value pairs, and their values can contain a combination of text and template code that is evaluated when the alert fires.&lt;/p&gt;
&lt;p&gt;Annotations can contain plain text, but you should template annotations if you need to display query values that are relevant to the alert, for example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show the query value that triggers the alert.&lt;/li&gt;
&lt;li&gt;Include labels returned by the query that identify the alert.&lt;/li&gt;
&lt;li&gt;Format the annotation message depending on a query value.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here’s an example of templating an annotation, which explains where and why the alert was triggered. In this case, the alert triggers when CPU usage exceeds a threshold, and the &lt;code&gt;summary&lt;/code&gt; annotation provides the relevant details.&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;The outcome of this template would be:&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;p&gt;Implement annotations that provide meaningful information to respond to your alerts. Annotations are displayed in the Grafana alert detail view and are included by default in notifications.&lt;/p&gt;
&lt;p&gt;For more details on how to template annotations, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/templates/&#34;&gt;Template annotations and labels&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;template-labels&#34;&gt;Template labels&lt;/h2&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rules/annotation-label/#labels&#34;&gt;Labels&lt;/a&gt; are used to differentiate one alert instance from all other alert instances, as the set of labels uniquely identifies an alert instance. Notification policies and silences use labels to handle alert instances.&lt;/p&gt;
&lt;p&gt;You can also template labels based on query results. This is helpful if the labels you get from your query aren&amp;rsquo;t detailed enough. For instance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a new label to change how alerts are identified and grouped into different alert groups.&lt;/li&gt;
&lt;li&gt;Add a new label used by notification policies or silences to manage how the alert is handled.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here’s an example of templating a new &lt;code&gt;env&lt;/code&gt; label based on the value of a query label:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Go&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-go&#34;&gt;{{- if eq $labels.instance &amp;#34;prod-server-1&amp;#34; -}}
production
{{- else if eq $labels.instance &amp;#34;staging-server-1&amp;#34; -}}
staging
{{- else -}}
development
{{- end -}}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For more details on how to template labels, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/templates/&#34;&gt;Template annotations and labels&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;template-notifications&#34;&gt;Template notifications&lt;/h2&gt;
&lt;p&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/configure-notifications/template-notifications/&#34;&gt;Notification templates&lt;/a&gt; allow you to customize the content of your notifications, such as the subject of an email or the body of a Slack message.&lt;/p&gt;
&lt;p&gt;Notification templates differ from templating annotations and labels in the following ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Notification templates are assigned to the &lt;strong&gt;Contact point&lt;/strong&gt;, rather than the alert rule.&lt;/li&gt;
&lt;li&gt;If not specified, the contact point uses a default template that includes relevant alert information.&lt;/li&gt;
&lt;li&gt;The same template can be shared across multiple contact points, making it easier to maintain and ensuring consistency.&lt;/li&gt;
&lt;li&gt;Notification templates should not be used to add additional information to individual alerts—use annotations for that purpose.&lt;/li&gt;
&lt;li&gt;While both annotation/label templates and notification templates use the same templating language, the available variables and functions differ. For more details, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/configure-notifications/template-notifications/reference/&#34;&gt;notification template reference&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/templates/&#34;&gt;annotation/label template reference&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is an example of a notification template that summarizes all firing and resolved alerts in a notification group:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Go&lt;/span&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 class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-go&#34;&gt;{{ define &amp;#34;alerts.message&amp;#34; -}}
  {{ if .Alerts.Firing -}}
    {{ len .Alerts.Firing }} firing alert(s)
    {{ template &amp;#34;alerts.summarize&amp;#34; .Alerts.Firing }}
  {{- end }}
  {{- if .Alerts.Resolved -}}
    {{ len .Alerts.Resolved }} resolved alert(s)
    {{ template &amp;#34;alerts.summarize&amp;#34; .Alerts.Resolved }}
  {{- end }}
{{- end }}

{{ define &amp;#34;alerts.summarize&amp;#34; -}}
  {{ range . -}}
  - {{ index .Annotations &amp;#34;summary&amp;#34; }}
  {{ end }}
{{ end }}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The notification message to the contact point would look like this:&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;1 firing alert(s)
- The database server db1 has exceeded 75% of available disk space. Disk space used is 76%, please resize the disk size within the next 24 hours.

1 resolved alert(s)
- The web server web1 has been responding to 5% of HTTP requests with 5xx errors for the last 5 minutes.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For more details, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/configure-notifications/template-notifications/&#34;&gt;Template notifications&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="templates">Templates&lt;/h1>
&lt;p>Use templating to customize, format, and reuse alert notification messages. Create more flexible and informative alert notification messages by incorporating dynamic content, such as metric values, labels, and other contextual information.&lt;/p></description></item></channel></rss>