Alertmanager show text based on the alert

14 views
Skip to first unread message

nesa...@gmail.com

unread,
Sep 29, 2020, 10:11:04 AM9/29/20
to Prometheus Users
Hi
Some of our Prometheus rules have "message" label as the description and some of them have "description" label as the description.
I wonder if it is possible to set "message" as text if the rule has "message" annotation and set "description" as text if the rule has "description" as the annotation.
Also, I would like to include "<br>" HTML tag after the "description" or "message"
So here is my configuration for the alertmanager but is it not sending any alerts and I don't see any errors in the log files:
 
"text": "{{ range .Alerts }}{{ .Annotations.description }}{{ .Annotations.message }} <br> {{ end }}"

Reply all
Reply to author
Forward
0 new messages