alertmanager.yml organizes notification behavior into three primary sections:
- global — default values applied across the configuration (can be overridden per receiver).
- route — routing tree that determines which alerts are sent to which receivers.
- receivers — concrete integrations (Slack, email, PagerDuty, etc.) used to deliver notifications.
Global
Global settings set common defaults consumed by receiver configurations. These are useful for sharing SMTP, Slack webhook, or PagerDuty defaults across multiple receivers.Top-level route (default / fallback)
The top-levelroute defines default routing behavior and acts as the fallback for alerts that don’t match any child routes. You typically set default receiver, group_by, and other defaults here.
- Default: alerts are grouped by
alertnameandjoband go tostaff. - Child routes override the top-level defaults when an alert matches.
- Alerts with
jobmatching(node|windows)go toinfra-email. - Alerts with
job: kubernetesgo tok8s-slack.
Receivers
Receivers define how alerts are forwarded to external systems. Each receiver must have aname and one or more integration configurations.
- Receivers are referenced by
receiverfields in routes. - Templates like
{{ .GroupLabels.app }}are evaluated by Alertmanager when building messages.
Matching: match vs match_re
Routes select alerts using matchers. Two common matcher types:
Combined example:
match requires exact values; match_re supports regex patterns. Use match_re when you need pattern-based selection.
When using regular expressions, be explicit and test your patterns. A broad regex can unintentionally match many alerts and bypass more specific
match routes.Sub-routes (nested routes)
Routes can be nested to express hierarchical routing rules. Parent routes are evaluated first; child routes refine behavior for a subset of alerts.- Alerts with
job: kubernetesdefault tok8s-email. - If an alert also has
severity: pager, the child route matches and routes tok8s-pagerinstead.
group_by from their parent unless they specify their own.
Example: Multiple teams with sub-routes
A common pattern is to create one parent route per team and nest child routes for severity or environment-specific behavior.- Parent route
team: databasedefaults todatabase-pager. Child routes route specific severities to alternate receivers. team: apidemonstrates environment-specific routing (e.g.,env: dev) and severity-based fallbacks.
Reloading configuration
Alertmanager does not automatically detect changes toalertmanager.yml. To apply updates you must reload the process. Common methods:
- Restart the Alertmanager process (e.g., systemd restart).
- Send a SIGHUP to the process.
- POST to the internal
/-/reloadHTTP endpoint.
To reload Alertmanager without a full restart you can send SIGHUP (for example:
sudo killall -HUP alertmanager) or make an HTTP POST to /-/reload.Sending an alert to multiple routes (continue)
By default, once an alert matches a route and is processed, Alertmanager stops evaluating further top-level routes for that alert. If you want an alert to be delivered to multiple receivers (for example, a generic logs receiver plus a team-specific receiver), usecontinue: true on a route.
- Alerts are first handled by the
alert-logsroute and processing continues because ofcontinue: true. - If the same alert also matches
job: kubernetes, it will additionally be sent tok8s-email.
Grouping alerts (group_by)
Alertmanager groups alerts that match a route into a single notification. Usegroup_by to control which labels determine grouping granularity.
- Top-level
group_by: [team]ensures each distinctteamvalue produces its own grouped notification. - The
infrachild route overrides grouping to[region, env]so infra alerts are split by region and environment. - Child routes inherit unspecified fields from their parent, so you only need to override
group_bywhere you want different grouping behavior.