Enhance AlertManagerConfig documentation with detailed comments on receivers, inhibit rules, and routing configurations

Sofiane Gerhardt 2025-10-15 17:13:16 +02:00
parent 4c34aac394
commit d01bea732b
Signed by: sofiane.gerhardt
SSH key fingerprint: SHA256:B+mV6AyYLX4aUI1b5gXcuADKOT8LepFIxknwPyd26f0

@ -34,6 +34,7 @@ kind: AlertmanagerConfig
metadata:
name: alerts
spec:
# Receivers define destinations for alerts (email, pagerduty, webhook, etc.)
receivers:
- name: email-receiver
emailConfigs:
@ -47,8 +48,10 @@ spec:
sendResolved: true
headers:
- key: Subject
# Template used to format email subject. Includes namespace, status and group labels.
value: '[{{ .CommonLabels.namespace }}][{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join " " }} {{ if gt (len .CommonLabels) (len .GroupLabels) }}({{ with .CommonLabels.Remove .GroupLabels.Names }}{{ .Values | join " " }}{{ end }}){{ end }}'
# InhibitRules suppress notifications for lower-severity alerts when a matching higher-severity alert is firing
inhibitRules:
- sourceMatch:
- name: severity
@ -56,16 +59,19 @@ spec:
targetMatch:
- name: severity
value: warning
equal: ["alertname"]
equal: ["alertname"] # Fields that must match between source and target alerts to apply inhibition
# Route defines how alerts are grouped and which receiver is used by default
route:
groupBy:
- alertname
- alertname # Alerts with the same values for these labels are grouped together
- severity
groupWait: 30s
groupInterval: 5m
repeatInterval: 12h
receiver: email-receiver
groupWait: 30s # Wait time to collect alerts before sending first notification for a group
groupInterval: 5m # Minimum interval between notifications for an alert group
repeatInterval: 12h # How often to resend notifications for ongoing alerts
receiver: email-receiver # Default receiver for alerts that don't match child routes
# Child routes allow overriding routing for specific alert matchers (e.g., severity)
routes:
- matchers:
- name: severity