Include device name in the alert notification


I have a monitoring system that sends an alert if one or many devices stop sending data. However, the notifications do not contain information about which device is not sending the data. I am using Grafana V9.4.9. In the notifications, I would like to include the information of the device that is not sending the data. Could you please provide me with the steps to include device information in the alert notification?

Thanks in advance.


can you show us the alert definition?

Is the device a metric label? if so, you can include it the description/summary using either this:

device: {{ $labels.<device_label_name> }}


device: {{ $values.<query_name_that_generates_the_label>.Labels.<device_label_name> }}


Thanks for your response. Here are some more details about my data table.

In my alert condition data is obtained from the data table “datatable-2-hours-alerting”. Which contains the measurements of multiple devices.

I have used the Group By-> tag(device) to get all the device information in the same panel.

How can I include a particular device kin the notification which is not sending data from the list of devices.

I also can’t get these tags into the template.
datasource: influxdb + influxql query
@clevernessisamyth maybe have some ideas?