global:
smtp_smarthost: 'smart_host_address'
smtp_from: 'sen...@example.com'
templates:
- '/etc/alertmanager/email.tmpl'
# The primary route on which each incoming alert enters.
route:
# Default receiver
receiver: webhook-receiver
group_by: ['namespace', 'alertname']
group_wait: 15s
group_interval: 15s
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them. Very high repeat_interval means we don't want repeat email alerts
repeat_interval: 1h
routes:
- match:
alertname: 'alert_a'
group_by: ['deployment', 'namespace']
receiver: email-alert
repeat_interval: 52w
continue: true
- match:
alertname: 'alert_a'
group_by: ['deployment', 'namespace']
receiver: webhook-receiver
repeat_interval: 10m
continue: true
- match:
alertname: 'alert_b'
group_by: ['pod', 'namespace']
receiver: email-alert
repeat_interval: 52w
continue: true
- match:
alertname: 'alert_b'
group_by: ['pod', 'namespace']
receiver: webhook-receiver
repeat_interval: 10m
continue: true
receivers:
- name: 'email-alert'
email_configs:
- to: <email_address_goes_here>
html: '{{ template "email.html" . }}'
send_resolved: false
require_tls: false
- name: 'webhook-receiver'
webhook_configs:
- send_resolved: true
url: '<webhook_URL_goes_here>'global: resolve_timeout: 5m http_config: {} smtp_from: <email_address> smtp_hello: localhost smtp_smarthost: <smart_smtphost_address> smtp_require_tls: trueroute: receiver: webhook-receiver group_by: - namespace - alertname routes: - receiver: email-receiver group_by: - deployment - namespace match: alertname: alert_a continue: true repeat_interval: 52w - receiver: webhook-receiver group_by: - deployment - namespace match: alertname: alert_a continue: true repeat_interval: 10m - receiver: email-receiver group_by: - pod - namespace match: alertname: alert_b continue: true repeat_interval: 52w - receiver: webhook-receiver group_by: - pod - namespace match: alertname: alert_b continue: true repeat_interval: 10m group_wait: 15s group_interval: 15s repeat_interval: 1hreceivers:- name: email-receiver email_configs: - send_resolved: false to: <email_address> from: <sender_email_address> hello: localhost smarthost: <smart_smtphost_address> headers: From: <sender_email_address> Subject: '{{ template "email.default.subject" . }}' To: <email_address> html: '{{ template "email.alerting.html" . }}' require_tls: false- name: webhook-receiver webhook_configs: - send_resolved: true http_config: {} url: <webhook_url_goes_here>templates:- /etc/alertmanager/email.tmpl