How can i add different email template in my alertmanager for different alerts.As i need different subject line for each alert.

55 views
Skip to first unread message

Pooja Chauhan

unread,
Apr 23, 2020, 9:09:15 AM4/23/20
to Prometheus Users
Hi ,
Need suggestion on how to add the email template in alertmanager.yml for different alerts . Since subject has to be changed with each different alerts.



Julius Volz

unread,
Apr 23, 2020, 10:10:01 AM4/23/20
to Pooja Chauhan, Prometheus Users

On Thu, Apr 23, 2020 at 3:09 PM Pooja Chauhan <pooja...@gmail.com> wrote:
Hi ,
Need suggestion on how to add the email template in alertmanager.yml for different alerts . Since subject has to be changed with each different alerts.



--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/6b66d9ab-f66a-45df-a54e-4594d30aaf36%40googlegroups.com.

Pooja Chauhan

unread,
Apr 23, 2020, 2:23:08 PM4/23/20
to Prometheus Users


On Thursday, April 23, 2020 at 6:39:15 PM UTC+5:30, Pooja Chauhan wrote:
Hi ,
Need suggestion on how to add the email template in alertmanager.yml for different alerts . Since subject has to be changed with each different alerts.
Can you please give one example. The document is not very clear.I am confused.


Julius Volz

unread,
Apr 23, 2020, 5:15:25 PM4/23/20
to Pooja Chauhan, Prometheus Users

--
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 prometheus-use...@googlegroups.com.

Pooja Chauhan

unread,
Apr 24, 2020, 3:54:03 AM4/24/20
to Prometheus Users
When i am using subject it adds the subject line on the mail,that works but the html part which i have added is not working .I dont get mail with previous html format with updated subject line.


  - name: Monitoring
    email_configs:
      -  to: 'pooja...@gmail.com'
         html: '{{ template "email.cloud.html" . }}'         ------------------------------this part is not working it seems.
         headers:
           'subject': 'Alert'        -------------------------this works now
Any suggestion on how to resolve this.



Thanks


On Thursday, April 23, 2020 at 6:39:15 PM UTC+5:30, Pooja Chauhan wrote:
Reply all
Reply to author
Forward
0 new messages