Oreon IT Helm charts / alertmanager-routing-baseline

alertmanager-routing-baseline Helm chart

Version 0.1.1 · app 0.1.0 · MIT · source · Artifact Hub

Alertmanager routing that most teams end up hand-writing, generated from a values file:

It renders one AlertmanagerConfig (monitoring.coreos.com/v1alpha1) for the Prometheus Operator.

Install

kubectl -n monitoring create secret generic alertmanager-secrets \
  --from-literal=platform-slack-webhook=https://hooks.slack.com/services/... \
  --from-literal=platform-pagerduty-routing-key=...

helm repo add oreonit https://oreondev.github.io/helm-charts
helm install routing oreonit/alertmanager-routing-baseline -n monitoring -f routing.yaml

routing.yaml:

receivers:
  platform-slack:
    slack:
      apiURL: {name: alertmanager-secrets, key: platform-slack-webhook}
      channel: "#platform-alerts"
  platform-pager:
    pagerduty:
      routingKey: {name: alertmanager-secrets, key: platform-pagerduty-routing-key}
      severity: critical

teams:
  - name: platform
    matchers: ["team=platform"]
    page: platform-pager
    ticket: platform-slack
  - name: payments
    matchers:
      - {name: namespace, value: "payments|checkout", matchType: "=~"}
    page: platform-pager
    ticket: platform-slack
    muteTicketsOutsideBusinessHours: true

fallback:
  receiver: platform-slack
  page: platform-pager

Global or namespaced: read this

The Prometheus Operator, by default, adds a namespace="<object's namespace>" matcher to every route of an AlertmanagerConfig, so the object only routes alerts from its own namespace. For a cluster-wide routing tree do one of these in kube-prometheus-stack:

alertmanager:
  alertmanagerSpec:
    # Option A: let AlertmanagerConfigs match alerts from any namespace
    alertmanagerConfigMatcherStrategy:
      type: None
    # Option B: make this object the whole configuration (must be in Alertmanager's namespace)
    alertmanagerConfiguration:
      name: routing-baseline

With option B the operator uses this object as the root config; alertmanagerConfigSelector is no longer needed. Without either option the chart still works, but only for alerts carrying the release namespace.

Alerts from the Prometheus Operator's own rules (kube-prometheus-stack defaults) have no team label. Give them one in your additionalRuleLabels, or route them by namespace as in the payments example, or let them land in fallback.receiver.

Values

Key Default Description
name routing-baseline AlertmanagerConfig name
labels {} Labels for the Alertmanager's alertmanagerConfigSelector
route.groupBy [alertname, namespace] Grouping labels
route.groupWait / groupInterval / repeatInterval 30s / 5m / 4h Root route timings
route.pageRepeatInterval 1h Repeat interval for page severities
severity.label severity Label carrying severity
severity.page / ticket / info [critical] / [warning] / [info] Severity values per class
receivers.<name>.<integration> {} slack, pagerduty, opsgenie, email, msteams, webhook; the map is the AlertmanagerConfig field set for that integration
slackDefaults.title / text see values.yaml Slack templates applied when a receiver sets none
teams[] [] name, matchers, page, ticket, info, muteTicketsOutsideBusinessHours
fallback.receiver / fallback.page "" Receivers for unmatched alerts / unmatched pages
watchdog.* enabled, Watchdog, null receiver Where the liveness alert goes
inhibit.criticalInhibitsWarning true Same alertname+namespace
inhibit.pageInhibitsTicket true Same slo label
inhibit.extra [] Raw inhibitRules
timeIntervals.businessHours Mon–Fri 09:00–18:00 UTC Defines "outside business hours"
timeIntervals.extra [] Raw muteTimeIntervals (maintenance, holidays)
extraRoutes [] Raw routes tried before the team routes
nullReceiver null Name of the drop receiver

Matchers accept strings (team=platform, namespace=~"a|b", severity!=info) or objects ({name, value, matchType}).

Notes

The routing here follows the on-call model we run for clients under SRE as a service: pages are rare and actionable, everything else is a ticket, and nothing wakes anyone for information.

Licence

MIT. Maintained by Oreon IT.

Oreon IT

Maintained by Oreon IT

A London cloud, DevOps and SRE consultancy. If you want this chart rolled out and tuned for your platform, we can help.