Grafana 8 - access alert info in message (ngalert)

I set up an alert rule in Grafana v8.0.1 using the new grafana 8 alerts. When I click preview your alert in the Create alert rule UI I get the following table:

State Info
Alerting [ metric=‘hostxzy’ labels={instance=hostxyz:1234, job=name} value=100 ]

How can I access the values from the Info column in the summary in the Add details for your alert section? I would like to include the instance and value entries in the alert message. (I’ve tried all kinds of combinations of {{}} and $, but didn’t get the values in the alert message)

Thank you for your help!

1 Like

Hi, it is supposed to be {{ $labels.your_label }} as explained here : Create Grafana managed alert rule | Grafana Labs

But I get the same problem than you, the label is empty when I do that…

using reduce and math as suggested here works.

1 Like

Thanks for the solution !
It works for labels, but how can I get the value that triggered the alert ? {{ value }} and {{ labels.value }} doesn’t work for me

1 Like

Did you ever find a way to get the value? I’m looking for the same.

We’ve recently merged a PR that will add this in 8.1 Alerting: Expand the value string in alert annotations and labels by gerobinson · Pull Request #37051 · grafana/grafana · GitHub