forked from ancore-org/ancore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalertmanager.yml
More file actions
63 lines (55 loc) · 1.99 KB
/
Copy pathalertmanager.yml
File metadata and controls
63 lines (55 loc) · 1.99 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
# Alertmanager routing — ancore mainnet
# Assumes Prometheus + Alertmanager. Adapt metric names to actual instrumentation.
# Secrets injected via environment variables. Never hardcode credentials.
# Set PAGERDUTY_ROUTING_KEY and SLACK_WEBHOOK_URL in deployment environment.
global:
resolve_timeout: 5m
route:
receiver: slack-default
group_by: ['alertname', 'job', 'severity']
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
routes:
- match:
severity: critical
receiver: pagerduty-critical
repeat_interval: 1h
continue: true
- match:
escalation: pagerduty
receiver: pagerduty-critical
continue: true
- match:
escalation: slack
receiver: slack-default
receivers:
- name: pagerduty-critical
pagerduty_configs:
- routing_key: '${PAGERDUTY_ROUTING_KEY}'
severity: '{{ if eq .CommonLabels.severity "critical" }}critical{{ else }}warning{{ end }}'
description: '{{ .CommonAnnotations.summary }}'
details:
runbook: '{{ (index .Alerts 0).Annotations.runbook_url }}'
dashboard: '{{ (index .Alerts 0).Annotations.dashboard_url }}'
service: '{{ .CommonLabels.job }}'
- name: slack-default
slack_configs:
- api_url: '${SLACK_WEBHOOK_URL}'
channel: '#ancore-alerts'
send_resolved: true
title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }} 🔥{{ else }} ✅{{ end }}] {{ .CommonAnnotations.summary }}'
text: |
{{ range .Alerts }}
*Severity:* {{ .Labels.severity }}
*Description:* {{ .Annotations.description }}
*Runbook:* {{ .Annotations.runbook_url }}
{{ if .Annotations.dashboard_url }}*Dashboard:* {{ .Annotations.dashboard_url }}{{ end }}
{{ end }}
inhibit_rules:
# Suppress warning-level alerts when a critical alert fires for the same job
- source_match:
severity: critical
target_match:
severity: warning
equal: ['alertname', 'job']