Prometheus templating - sample

61 views
Skip to first unread message

Yann “Stratanic” .mabilat

unread,
Nov 25, 2023, 1:48:10 PM11/25/23
to Prometheus Users
Hello, 
I use last version prometheus and alertmanger -(Nov 2023)
I'm try use Prometheus templating. anyone can explain how define template?

many sample here in the official website,

but they dont describe where put the template exactly ? which file ?

{{/* Define the template */}} {{define "myTemplate"}} do something {{end}} {{/* Use the template */}} {{template "myTemplate"}}

Ok, but where, put this ?

I can declare template file in /.../alertmanager.yml   (conf file)


templates:
- /etc/prometheus/templates/*.tmpl





--------------------------------------

Final goal : reduce a text in rule of alertmanager (for alerta)

I hope to get help with this case. thanks all.


Reply all
Reply to author
Forward
0 new messages