I added it to the Description and I’m getting the message below:
- description = The disks are almost full for the applications below:
<no value> - <no value> - %!f(<nil>)%
<no value> - <no value> - %!f(<nil>)%
I also tried looping the values and didn’t work. Like:
{{ range .Value}}<strong>{{ .Name }}</strong>: {{ .Value }} {{ end }}
{{ range .Value}}<strong>{{ $labels.host.name }}</strong>: {{ .Value }} {{ end }}
{{ range .Labels}}<strong>{{ .Name }}</strong>: {{ .Value }} {{ end }}
A loop was going to work better in my case because the number of values varies. I was trying to get a specific item first because it will be helpful in other situations. However, I couldn’t get the values in both cases.
I think the problem may be due the fact that you have a dot ( . ) in the label names. Can you try the same thing with but a label like “hostname” (instead of “host.name”)?
Hello
New to the new alerting system - we have tons of alerts and i really dislike the new output
How can we make it print only the relevant alerting label?
Is there a way to control how the alerts are being migrated to the unified alerting system? (we have hundreds of legacy alerts on grafana 8)
I was using this templating with GO range but since latest version, new alerting format has 2 expressions: B is a reduce (get single value from query) and C is a threshold (evaluates B).
This format is mandatory for managing silence correctly but as a result, the alert template issues value for both queries for each alerts which is not convenient.
However, using variables in the format {{ $labels.instance }} became possible again (because labels are the same between the 2 expressions.
To get value from var='B', simply use this format {{ $values.B }}.