Grafana 11.3: humanizeDuration function is not defined

the official documentation lists humanizeDuration function as available in grafana.

So i try to use it like this:

{{ if index .Labels “transaction.duration.us” }}
{{ $duration := index .Labels “transaction.duration.us” }}
Query duration: {{ humanizeDuration $duration }}
{{ end }}

But grafana complains that “function humanizeDuration is not defined”.

The documentation says nothing about the definition about the function. Whats going on then?

PS: the value of transaction.duration.us is in microseconds - is that a problem?

Hi @paxistas,

You might running into this issue because humanizeDuration is only available in alert rule templates, not in notification templates.