Alertmanager routing: sending the right alert to the right team

Alertmanager routing: the route tree, group_by, receivers and inhibit_rules to send the right alert to the right team, checked with amtool.
Routage Alertmanager : envoyer la bonne alerte à la bonne équipe

It is 3 a.m. A node dies and the on-call engineer gets forty pages: one per pod, one per latency alert, one per endpoint. Detection worked. What failed is Alertmanager routing: who receives what, grouped how, and which alerts should stay quiet once the cause is already known. This article starts from that operational decision and builds a configuration step by step.

The facts come from the Alertmanager configuration page on prometheus.io and the project’s GitHub page, both read on 12 November 2026. I could not run amtool for this article, so its commands are examples for you to check on your own setup.

To write the alerts themselves (for, promtool tests), see Prometheus alerting rules and promtool in CI. Here we cover what comes next: Prometheus has already sent the alert to Alertmanager.

The problem: an alert is not a notification

Prometheus evaluates rules and passes on the alert state. Alertmanager then decides whether to group, delay, repeat or silence them. Three operational questions follow:

  • Who gets woken up, and who can wait until morning?
  • How many messages may a single outage produce?
  • Which alert becomes pointless as soon as another one is active?

The first is routing, the second is grouping, the third is inhibition. Each has its own block in the configuration file.

Alertmanager routing: the route tree

The configuration describes a tree. The root must accept every alert, so it cannot carry matchers. Each child under routes narrows the choice. An alert walks down the tree and stops at the first child that matches, unless that node sets continue: true.

The grouping fields, with the documented defaults, are inherited from the parent when omitted:

  • group_by: the labels that define a group. The special value '...' disables aggregation.
  • group_wait (default 30s): how long to wait before the first notification of a new group, so that related alerts can join it.
  • group_interval (default 5m): how long to wait before notifying about alerts added to a group that was already notified.
  • repeat_interval (default 4h): how long to wait before resending a notification already sent. The page says it is rounded up to a multiple of group_interval.

Here is an example for an imaginary team. Service, receiver and interval names are sample values.

alertmanager.yml file: root route grouped by alertname and cluster, a payment on-call sub-route for service paiement with severity page, a platform ticket sub-route limited to working hours, and three receivers

Reading the example: an alert from the paiement service with severity page goes to astreinte-paiement and leaves after 10s instead of 30s, because payments cannot wait. An alert with severity ticket goes to ticket-plateforme, active only during the heures-ouvrees interval. Everything else lands on the root, hence on equipe-defaut.

The heures-ouvrees interval must be declared in the file’s time_intervals section, which I have not detailed here: see the official page for its syntax. The documentation states that the root cannot have active_time_intervals or mute_time_intervals, and that these fields are not inherited.

Choose group_by by outage, not by tool

Grouping by alertname and cluster means the same alert firing on twenty pods of one cluster yields one message. Conversely, '...' sends one notification per alert: keep it for cases where each alert needs its own action. A group_by that is too fine brings the noise back; one that is too broad hides unrelated failures in a single message.

When to use continue

By default, the first matching child wins. With continue: true, the alert keeps going to the next siblings. The documentation’s example uses it to send one alert to two destinations: a development team, muted outside office hours, and a pager active only at night and on holidays. Use it sparingly: every continue can double a message.

Receivers: where the notification goes

A receiver has a name and one or more lists of integrations. The documentation lists many, including email_configs, slack_configs, pagerduty_configs, opsgenie_configs, msteamsv2_configs (msteams_configs is deprecated) and webhook_configs. The webhook is the universal exit: it reaches any tool without a dedicated integration.

An operational tip: a receiver with no integration, as in the example, acts as a sink. It is handy for testing routing without sending messages, but it also swallows alerts. Never leave the default receiver empty in production.

For message formatting to Slack or Teams on the Dynatrace side, see Dynatrace alerts to Slack and Teams: it is a separate mechanism, which this article does not mix with Alertmanager.

Alert inhibition: silencing symptoms of a known cause

An inhibition rule mutes target alerts while a source alert is active. It has three blocks:

  • source_matchers: the alert that must exist for the inhibition to apply;
  • target_matchers: the alerts that will be muted;
  • equal: the labels that must have the same value on both sides.
inhibit_rules block: rule noeud-down-masque-pods with source NoeudInjoignable, targets PodNonPret and LatenceHaute, equal on cluster and noeud, followed by two amtool config routes commands

In this example, while NoeudInjoignable is active on a given node, the PodNonPret and LatenceHaute alerts from the same cluster and node are muted. Without equal, one node failure would silence those alerts on every node: the classic trap. That shared label is what bounds the effect.

The documentation flags two subtleties. A missing label equals an empty label, so if the equal labels are missing on both sides, the rule still applies. And an alert matching both sides of a rule cannot be inhibited by an alert that also matches both sides, itself included. So pick matchers that no alert satisfies on both sides, which I did by naming the target alerts explicitly.

Inhibition fixes nothing: it hides. If the source is detected badly, you lose the targets too. Keep rules short, named (the name field is optional) and justified in the repository.

Testing routing with amtool

amtool is Alertmanager’s command-line tool. According to the repository page, amtool config routes test shows which receivers match given labels, with --config.file and --tree, and --verify.receivers makes the command exit with code 1 on a mismatch. amtool config routes prints the tree of a remote Alertmanager through --alertmanager.url.

  1. Write or edit alertmanager.yml.
  2. Test a realistic label set with config routes test and check the expected receiver.
  3. Add the command to CI, one case per sub-route.
  4. After deployment, compare with config routes on the live instance.

I did not run these commands: the exact way to pass labels and the output vary by version, so check with --help. See also reducing Davis alert noise for the Dynatrace counterpart, and SLO burn rate alerts to decide which alerts deserve a page.

Best practices

  • A severity label with two values only (page, ticket) keeps routing readable.
  • One group_by per typical outage, and a short group_wait only for critical routes.
  • Short inhibitions, with equal always set.
  • One routing test per sub-route, run in CI.
  • A default receiver that is really monitored: an unrouted alert must not vanish.

Frequently asked questions

What is the difference between a silence and an inhibition?

A silence is set by hand for a given duration, for example with amtool silence add. An inhibition is a permanent rule in the configuration, triggered by another alert.

Why does my alert not reach the right receiver?

Often an earlier child matches first and the alert stops there, for lack of continue. Test the exact labels with amtool config routes test --tree to see the path taken.

Can I use Alertmanager with Dynatrace?

Alertmanager is a Prometheus component, separate from Dynatrace. This article describes no direct integration; alerting on the Dynatrace side follows its own mechanisms, detailed in its documentation.

Conclusion

Good Alertmanager routing boils down to three decisions: who receives, how many messages, and which alerts stay quiet. Write the tree, group by outage, inhibit with equal, then test with amtool. Sources: Alertmanager configuration and the Alertmanager repository (Apache 2.0 licence).

span.observer is an independent community blog, not affiliated with Dynatrace LLC. Dynatrace is a trademark of its owner. Prometheus and Alertmanager are Cloud Native Computing Foundation projects. Tools change: always check the official documentation before a production change.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
Thanos Prometheus haute disponibilité et stockage long terme

Thanos Prometheus high availability and long-term storage

Related Posts