1# ============================================================================= 2# Alertmanager config (TASK-0135, phase-15) 3# 4# Routing by severity: 5# page → webhook (the platform's OWN incoming-webhook automation — the 6# self-dogfood: an automation that posts to the admin channel) 7# + email (the ops mailbox; the production path is the nodemailer 8# email queue, per the spec — the SMTP receiver here is the direct 9# equivalent for a plain cluster) 10# warn → email only (webhook is page-only, per the spec) 11# 12# repeat_interval: 4h (the spec). 13# 14# PLACEHOLDERS — replace before staging apply: 15# 1. `ALERT_WEBHOOK_URL`: the platform's incoming-webhook endpoint. The 16# value below is the documented self-dogfood URL pattern; substitute the 17# real per-environment webhook (it is environment-specific and would be 18# injected via the alertmanager Secret in production). 19# 2. `ALERT_EMAIL_TO` + the smtp block: ops@ai-software-factory.com is the 20# on-call mailbox placeholder; wire the real SMTP relay (host/port/ 21# credentials via Secret — never in this file). 22# ============================================================================= 23global: 24 resolve_timeout: 5m 25 smtp_smarthost: "smtp.example.com:587" # REPLACE: the real SMTP relay 26 smtp_from: "factory-alerts@ai-software-factory.com" 27 smtp_require_tls: true 28 # smtp_auth_username / smtp_auth_password come from the alertmanager 29 # Secret (created out-of-band, like factory-secrets) — not here. 30 31route: 32 receiver: ops-email 33 repeat_interval: 4h 34 group_by: [alertname, severity] 35 group_wait: 30s 36 group_interval: 5m 37 routes: 38 - matchers: 39 - severity = page 40 receiver: page-webhook-email 41 repeat_interval: 4h 42 - matchers: 43 - severity = warn 44 receiver: ops-email 45 repeat_interval: 4h 46 47receivers: 48 # page: the platform's own incoming-webhook automation (self-dogfood) + email. 49 - name: page-webhook-email 50 webhook_configs: 51 - url: "https://platform.ai-software-factory.com/api/v1/webhooks/incoming/obs" # REPLACE: per-environment webhook 52 send_resolved: true 53 max_alerts: 100 54 email_configs: 55 - to: "ops@ai-software-factory.com" # REPLACE: the on-call mailbox 56 send_resolved: true 57 headers: 58 Subject: '[FIRE] {{ .GroupLabels.alertname }} ({{ .CommonLabels.severity }})' 59 # warn / default: email only. 60 - name: ops-email 61 email_configs: 62 - to: "ops@ai-software-factory.com" # REPLACE: the on-call mailbox 63 send_resolved: true 64 headers: 65 Subject: '[WARN] {{ .GroupLabels.alertname }}' 66 67inhibit_rules: 68 # A page suppresses its own warn for the same target (the page already 69 # carries the context; the warn would be noise on the same pod/queue). 70 - source_matchers: 71 - severity = page 72 target_matchers: 73 - severity = warn 74 equal: [queue, instance] 75