global: resolve_timeout: 5m smtp_from: 'alerts@v2-docker.com' smtp_smarthost: 'smtp.gmail.com:587' smtp_auth_username: '${SMTP_USERNAME}' smtp_auth_password: '${SMTP_PASSWORD}' smtp_require_tls: true # Templates for notifications templates: - '/etc/alertmanager/templates/*.tmpl' # Route tree route: group_by: ['alertname', 'cluster', 'service'] group_wait: 10s group_interval: 10s repeat_interval: 12h receiver: 'default' routes: # Critical alerts - match: severity: critical receiver: 'critical' continue: true # License abuse alerts - match: alertname: PossibleLicenseAbuse receiver: 'security' repeat_interval: 1h # Database alerts - match: service: postgres receiver: 'database' # Infrastructure alerts - match_re: alertname: ^(HighCPUUsage|HighMemoryUsage|LowDiskSpace)$ receiver: 'infrastructure' # Receivers receivers: - name: 'default' email_configs: - to: 'admin@v2-docker.com' headers: Subject: '[{{ .Status | toUpper }}] {{ .GroupLabels.alertname }}' html: |

Alert: {{ .GroupLabels.alertname }}

Status: {{ .Status }}

{{ range .Alerts }}

Summary: {{ .Annotations.summary }}

Description: {{ .Annotations.description }}

Labels:

{{ end }} - name: 'critical' email_configs: - to: 'critical-alerts@v2-docker.com' send_resolved: true webhook_configs: - url: '${WEBHOOK_CRITICAL}' send_resolved: true - name: 'security' email_configs: - to: 'security@v2-docker.com' webhook_configs: - url: '${WEBHOOK_SECURITY}' - name: 'database' email_configs: - to: 'dba@v2-docker.com' - name: 'infrastructure' email_configs: - to: 'ops@v2-docker.com' # Inhibition rules inhibit_rules: - source_match: severity: 'critical' target_match: severity: 'warning' equal: ['alertname', 'instance']