Repository navigation
Expand file tree
/
Copy pathalertmanager.yml
More file actions
79 lines (73 loc) · 2.58 KB
/
Copy pathalertmanager.yml
File metadata and controls
79 lines (73 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# =============================================================================
# Alertmanager configuration
# =============================================================================
# Receivers are configured from environment variables / secret files so that
# no credentials are committed to the repository. The alertmanager service in
# docker-compose.yml renders this file with `envsubst` before starting, using
# the ALERTMANAGER_* variables documented in .env.example.
#
# Routing:
# - critical -> PagerDuty + email (paging path)
# - warning -> Slack (non-paging path)
# - default -> Slack
# =============================================================================
global:
resolve_timeout: 5m
smtp_smarthost: '${ALERTMANAGER_SMTP_SMARTHOST}'
smtp_from: '${ALERTMANAGER_SMTP_FROM}'
smtp_auth_username: '${ALERTMANAGER_SMTP_AUTH_USERNAME}'
smtp_auth_password: '${ALERTMANAGER_SMTP_AUTH_PASSWORD}'
smtp_require_tls: true
# The root route dispatches by severity. Critical alerts page via PagerDuty
# and email; warnings go to Slack only.
route:
receiver: slack-warning
group_by: ['alertname', 'severity']
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- matchers:
- severity="critical"
receiver: pagerduty-critical
group_wait: 10s
repeat_interval: 1h
continue: true
- matchers:
- severity="critical"
receiver: email-critical
group_wait: 10s
repeat_interval: 1h
- matchers:
- severity="warning"
receiver: slack-warning
repeat_interval: 4h
receivers:
- name: slack-warning
slack_configs:
- api_url: '${ALERTMANAGER_SLACK_WEBHOOK_URL}'
channel: '${ALERTMANAGER_SLACK_CHANNEL}'
send_resolved: true
title: '[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}'
text: >-
{{ range .Alerts }}{{ .Annotations.summary }}
{{ .Annotations.description }}
{{ end }}
- name: pagerduty-critical
pagerduty_configs:
- service_key: '${ALERTMANAGER_PAGERDUTY_SERVICE_KEY}'
send_resolved: true
description: '{{ .CommonLabels.alertname }}: {{ .CommonAnnotations.summary }}'
- name: email-critical
email_configs:
- to: '${ALERTMANAGER_EMAIL_TO}'
send_resolved: true
headers:
Subject: '[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}'
inhibit_rules:
# A firing critical alert suppresses the matching warning for the same alert.
- source_matchers:
- severity="critical"
target_matchers:
- severity="warning"
equal: ['alertname']