Linux Labs

Observability: metrics, alerts, logs / Stage 5 of 9

Alertmanager: to whom and how many times

Not running Starting usually ~20 s
Leave the lesson

Step 3 of 6 · on a machine · 6 min

A silence for maintenance

Planned maintenance is known in advance: its notifications are muted for the right time without touching the configuration.

A silence is a condition on labels plus a time window: until the window ends, alerts with those labels produce no notifications. The alerts themselves stay in Alertmanager, but amtool alert does not show them; amtool alert query --silenced does. Silences are created with amtool, the Alertmanager client; it takes the service address from /etc/amtool/config.yml:

bash
amtool silence add alertname=InstanceDown \
  instance=db01:9100 --duration=30m \
  --comment='disk replacement on db01'
# active silences and their IDs
amtool silence query
# silenced alerts
amtool alert query --silenced
# end a silence early
amtool silence expire <ID>

The condition is labels separated by spaces, and all of them must match. The more precise the condition, the less gets silenced by accident: alertname=InstanceDown without a host would silence all 50 servers.

Exercise · do it

Silence a host for maintenance

web07 is under planned maintenance for two hours. Silence this host's alerts for that time, with a comment about the work; the other hosts' alerts must stay active.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Silence web07's alerts without touching other hosts not done yet
  • Give the silence the maintenance window not done yet

Step goals

0 of 2
  • Silence web07's alerts without touching other hosts — not done yet
  • Give the silence the maintenance window — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Silence web07's alerts without touching other hosts — not done yet
  • Give the silence the maintenance window — not done yet
Loading…