mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Docs: Add callout for variables behavior with classic conditions (#67253)
* Add doc on classic condition behaviour with labels * Update docs/sources/alerting/fundamentals/annotation-label/variables-label-annotation.md Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> --------- Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
This commit is contained in:
parent
b10d415569
commit
69402f859b
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user