Alert message templates

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

  • What are you trying to achieve?
    Showing the value in the alert message

  • How are you trying to achieve it?
    Using a template as follows: Water tank distance at {{ .Value }}

  • What happened?
    Output is: Water tank distance at [ metric=‘mqtt_consumer’ labels={host=REDACTED, topic=REDACTED} value=23.877 ]

  • What did you expect to happen?
    I want the message to read: Water tank distance at 23.877

  • Can you copy/paste the configuration(s) that you are having problems with?
    Water tank distance at {{ .Value }}

  • 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?
    Message templating | Grafana documentation
    Template data | Grafana documentation

Have you tried without .(dot)

Water tank distance at {{ Value }}
Could also be case sensitive. I see you have value with small v not capital.

/ Carsten

It turns out that I cannot do this with a “Classic Condition” In order for it to work I needed to use a Reduce expression to reduce the sample set to a single value then use a Math expression to give a value of 0 or 1.

I can then use something like {{ $values.B.Value }} in the alert summary

1 Like

This topic was automatically closed after 365 days. New replies are no longer allowed.