Hi all, I'm currently struggling to use reusable templates on Prometheus
alert annotation descriptions.
I'm using prometheus docker image and I've set a custom path in
"--web.console.libraries" (e.g. "/path/to/libraries/")
I defined a file (e.g. "/path/to/libraries/alert-mytemplate.lib") with a
template:
{{ define "mytemplate" }}
...
{{ end }}
And added this on some alerts annotations:
description: "{{ template \"mytemplate\" (args ...) }}"
However in runtime I still get the error that the template is not found
whenever the alert is triggered:
template \"mytemplate\" not defined
I'm trying to follow the instructions in [1][2] but I'm currently blocked,
can anyone understand what is it missing here?
[1]
https://prometheus.io/docs/prometheus/latest/configuration/template_examples/#defining-reusable-templates
[2]
https://prometheus.io/docs/prometheus/latest/configuration/template_reference/#console-templates
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/548a69e4-1515-4b98-82f3-03eb9e97825an%40googlegroups.com.