same here I try use template,
in last version prometheus
Le lundi 14 février 2022 à 16:19:36 UTC+1, Luís Martins a écrit :
> 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/75aa962b-5fe3-4447-acce-3ab06a26450bn%40googlegroups.com.