How do notification templates work in Alertmanager?
IntermediateConceptAlertmanager & Alerting
Answer
Receivers use Go templates over the grouped alert data (.Status, .CommonLabels, .CommonAnnotations, .Alerts):
receivers:
- name: payments-slack
slack_configs:
- channel: "#payments-alerts"
send_resolved: true
title: '[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}'
text: >-
{{ range .Alerts }}*{{ .Labels.instance }}*: {{ .Annotations.summary }}
Runbook: {{ .Annotations.runbook_url }}
{{ end }}
Shared templates live in files listed under templates:.
More on Alertmanager & Alerting
What does Alertmanager do that Prometheus does not?BeginnerExplain the Alertmanager routing tree.IntermediateWhat do `group_by`, `group_wait`, `group_interval` and `repeat_interval` control?IntermediateWhat is inhibition? Give an example.IntermediateWhat are silences and how do you create them?BeginnerWhat are mute time intervals and active time intervals?Intermediate