RousselTMLEARNING

Observability

Silences, inhibitions and time intervals in Alertmanager

Reduce alert noise: one-off silences with amtool, inhibition rules (a critical alert mutes secondary alerts) and time intervals (business hours, maintenance).

1. Silences #

Muting temporarily.

With amtool #

export ALERTMANAGER_URL=http://localhost:9093   # ou --alertmanager.url

# Créer un silence de 2 h pour la maintenance d'une base
amtool silence add instance="db-1:9100" --duration=2h \
  --author="martin" --comment="Maintenance planifiée CHG-1234"

amtool silence query                 # lister les silences actifs
amtool silence query -e              # y compris expirés
amtool silence expire <id>           # lever un silence
amtool alert query                   # alertes actives (non silencées)

A silence is a set of matchers and a time period. Matching alerts remain visible in the interface (marked silenced) but are no longer notified.

Common mistake: A silence that is too broad (severity=~".*") can hide a real incident for hours. Always limit a silence to one instance or service, with a short duration and a comment citing the change ticket.

2. Inhibitions #

One cause, one alert.

Principle #

When an entire datacenter is unreachable, there is no point receiving 300 « service down » alerts. An inhibition rule mutes target alerts as long as a source alert is active, provided they share the labels listed in equal.

inhibit_rules:
  # Une alerte critique tait la même alerte en warning
  - source_matchers: ['severity="critical"']
    target_matchers: ['severity="warning"']
    equal: [alertname, instance]
  # Le cluster est injoignable : on tait toutes ses autres alertes
  - source_matchers: ['alertname="ClusterUnreachable"']
    target_matchers: ['alertname!="ClusterUnreachable"']
    equal: [cluster]
Good to know: The Alertmanager interface shows inhibited alerts with the Inhibited filter: useful to check that a rule is not too broad.

3. Time intervals #

Respecting the teams' sleep.

Business hours and freeze periods #

time_intervals:
  - name: heures-ouvrees
    time_intervals:
      - weekdays: ['monday:friday']
        times: [{ start_time: '09:00', end_time: '18:00' }]
        location: Europe/Paris
  - name: nuit-et-week-end
    time_intervals:
      - weekdays: ['saturday', 'sunday']
      - times: [{ start_time: '18:00', end_time: '24:00' }, { start_time: '00:00', end_time: '09:00' }]
        location: Europe/Paris

route:
  receiver: defaut
  routes:
    - matchers: ['severity="warning"']
      receiver: equipe-mail
      mute_time_intervals: [nuit-et-week-end]     # pas de warning la nuit
    - matchers: ['severity="critical"']
      receiver: astreinte                          # le critique sonne 24 h/24

active_time_intervals does the opposite: the route is only active during the listed intervals (for example, a support channel open only during the day).

Related articles

Alertmanager: role, architecture and lifecycle of an alert

What Alertmanager does between Prometheus and your teams: deduplication, grouping, routing, silences and inhi…

Writing good Prometheus alerting rules (and testing them)

Design useful alerts: alert on symptoms, choose for and thresholds, severity and team labels, annotations and…

Routing, grouping and receivers in Alertmanager

The Alertmanager routing tree: matchers, group_by, group_wait, group_interval, repeat_interval, continue, rec…

Keep learning

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!