diff --git a/docs/sources/alerting/alerting-rules/templates/_index.md b/docs/sources/alerting/alerting-rules/templates/_index.md index cf211fed7b6..f6da85e1977 100644 --- a/docs/sources/alerting/alerting-rules/templates/_index.md +++ b/docs/sources/alerting/alerting-rules/templates/_index.md @@ -190,9 +190,7 @@ low In this example, the value of the `severity` label is determined by the query value, and the possible options are `critical`, `high`, `medium`, or `low`. You can then use the `severity` label to change their notifications—for instance, sending `critical` alerts immediately or routing `low` alerts to a specific team for further review. -{{% admonition type="note" %}} -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. -{{% /admonition %}} +{{< docs/shared lookup="alerts/note-dynamic-labels.md" source="grafana" version="" >}} ### How to template a label diff --git a/docs/sources/alerting/alerting-rules/templates/examples.md b/docs/sources/alerting/alerting-rules/templates/examples.md index c8c6f9dbb40..e9ee1a8015b 100644 --- a/docs/sources/alerting/alerting-rules/templates/examples.md +++ b/docs/sources/alerting/alerting-rules/templates/examples.md @@ -209,9 +209,7 @@ In this example, the `severity` label is determined by the query value: You can then use the `severity` label to control how alerts are handled. For instance, you could send `critical` alerts immediately, while routing `low` severity alerts to a team for further investigation. -{{% admonition type="note" %}} -You should avoid displaying query values in labels, as this may create many alert instances—one for each distinct label value. Instead, use annotations to convey query values. -{{% /admonition %}} +{{< docs/shared lookup="alerts/note-dynamic-labels.md" source="grafana" version="" >}} ### Based on query label diff --git a/docs/sources/shared/alerts/note-dynamic-labels.md b/docs/sources/shared/alerts/note-dynamic-labels.md new file mode 100644 index 00000000000..d657c4249a6 --- /dev/null +++ b/docs/sources/shared/alerts/note-dynamic-labels.md @@ -0,0 +1,14 @@ +--- +labels: + products: + - oss +title: 'Note Dynamic labels' +--- + +{{% admonition type="note" %}} + +An alert instance is uniquely identified by its set of labels. + +- Avoid displaying query values in labels, as this can create numerous alert instances—one for each distinct label set. Instead, use annotations for query values. +- If a templated label's value changes, it maps to a different alert instance, and the previous instance transitions to the `No data` state when its label value is no longer present. + {{% /admonition %}}