diff --git a/docs/sources/alerting/fundamentals/annotation-label/variables-label-annotation.md b/docs/sources/alerting/fundamentals/annotation-label/variables-label-annotation.md index 7044712eb47..8d935e91865 100644 --- a/docs/sources/alerting/fundamentals/annotation-label/variables-label-annotation.md +++ b/docs/sources/alerting/fundamentals/annotation-label/variables-label-annotation.md @@ -122,6 +122,14 @@ If the rule uses Classic Conditions instead of Threshold, Reduce and Math expres The first condition is {{ $values.B0 }}, and the second condition is {{ $values.B1 }} ``` +With classic conditions, labels from the query are not available in `$labels` variable, because single alert instance are generated. Instead, you can retrieve the labels from the `$values` variable. + +``` +{{ range $k, $v := $values }} +The value is {{ $v }} and the labels are {{ $v.Labels }} +{{ end }} +``` + ## Functions The following functions are also available when expanding labels and annotations: