Alert notifications don't show value of service name

  • What Grafana version and what operating system are you using?

    • Version 10.3.1
    • Red Hat Enterprise Linux release 8.10 (Ootpa)
  • What are you trying to achieve?

    • I would like alert notifications to include the actual service name that is critical
  • How are you trying to achieve it?

    • I’ve edited the alert rule so that “labels and notifications” use the following
    • service_name = {{ $labels.service_name }}

  • What happened?

    • The email notification looks like this

  • What did you expect to happen?

    • I would like the alert to print the actual service name instead of [no value]
  • Can you copy/paste the configuration(s) that you are having problems with?

    • Metrics Browser >
      • sum(consul_health_service_status{status=“critical”}) by (service_name) / count(consul_health_service_status{status=“critical”}) by (service_name)

Builder

Code

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

    • no
  • Did you follow any online instructions? If so, what is the URL?

    • no

You don’t need to specify it explicitly in labels/annotations usually (if you are using default notification template and query groups by that label - you have that in by, so run preview to verify that).

You have old Grafana version, so you may try to update it if you have still a problem (with backup of course).

Hi, it seems rigth. How do those settings look like?

If all the services are healhty and you have setting like these, you can get “No Data” alert that won’t have the data (a shot in the dark but it might be it :sweat_smile:)