Hi all, I tried it now for two days straight and I just don't get it working.
First of all where do I actually find the expressions I can use to define the subject under the header? I am still missing a template I can use? I don't really have one in my Prom/Alert-files.
Second of all my current receivers are configured like so:
receivers:
- name: 'email'
email_configs:
- to: 'X...@XXX.com'
send_resolved: true
headers:
Subject: "{{ .Alerts.alertname }} - {{ range .Alerts }} {{ .Alerts.instance }} {{ end }}"
Like Brian said, I want to iterate in the second half of that "statement" (I don't actually know how these {{ .xyz }} are called) through all instances and the first one should just say which alert is now firing.
I also tried it as followed:
Subject: "{{ .GroupLabels.alertname }} - {{ range .Alerts }} {{ .Alerts.instance }} {{ end }}"
and
Subject: "{{ .Labels.alertname }} - {{ range .Alerts }} {{ .Alerts.instance }} {{ end }}"
but nothing is really working.
All I really want is the Subject like so e.x.:
InstanceDown - SVR-DS01 SVR-DC11
^^^^^^^^ ^^^^^^^^ ^^^^^^^^
Alertname - Instance1 Instance2 (if it is also possible to seperate the instances via comma would be perfect)