Unable to use humanize functions in alert summary

Hi all!
I am new to Grafana and currently setting up a few alerts on some of my panels. In the alert settings, I can specify a summary. In this summary, I wrote a message which includes one of my expression results: The maximum iterator age has exceeded the limit! Current age: {{ $values.IteratorAgeSeconds }}
This works. Since the limit is 1800s, I would have liked to humanize it. I tried to write
The maximum iterator age has exceeded the limit! Current age: {{ humanizeDuration $values.IteratorAgeSeconds }} instead, which doesn’t work. It will just print out the whole string inside the curly braces. Can I not use the humanize function inside of a summary?

Hi! :wave: Please check our documentation, it has examples on how to do this Templating labels and annotations | Grafana documentation

Thank you! I forgot to add the .Value after the expression in the brackets in my experiments before.

{{ humanizeDuration (index $values "IteratorAgeSeconds").Value }}

Now it works as expected.

1 Like