monitoring: dead-man's switch does not cover Alertmanager death or total delivery failure #595

Stängd
öppnade 2026-10-08 17:48:12 +00:00 av supernaut · 2 kommentarer
Ägare

Nothing outside the monitoring VM notices if alerting itself stops.

The always-firing Watchdog alert routes to receiver watchdog, which has no integration (alertmanager.yml.j2, "Dead-man's-switch sink"). If Alertmanager, vmalert or the whole monitoring VM dies, every alert stops and nobody is told. #565 showed the cost: notifications failed silently for weeks.

AlertmanagerDeliveryFailing covers partial failure only. When every integration fails, it cannot reach anyone either.

Goal

A monitor outside the monitoring VM expects a regular Watchdog heartbeat and alerts on silence through a path that does not depend on Alertmanager.

Options

  1. Timer on the services host. It polls Alertmanager's API for an active Watchdog, or receives its webhook, and emails through the existing mail provider when the heartbeat is missing. No new service. Blind if both hosts die.
  2. Self-hosted Healthchecks on the services host. Watchdog's webhook pings a check URL, and Healthchecks emails on a missed ping. One more container. Same both-hosts-down limit.
  3. An external heartbeat service outside the platform. Survives both hosts. Must meet the hosting and privacy principles.

Tasks

  • Pick an option (state the trade-off in the issue).
  • Add the webhook to the watchdog receiver, and the monitor with its silence threshold (about 2 to 3 Watchdog repeat intervals). (dropped: option 1 was chosen, the existing probe polls the Alertmanager API)
  • Test: stop Alertmanager, confirm the alert arrives within the threshold, start it again.
  • Runbook: what the alert means and the first steps.

Related: #565, #461.

Nothing outside the monitoring VM notices if alerting itself stops. The always-firing `Watchdog` alert routes to receiver `watchdog`, which has no integration (`alertmanager.yml.j2`, "Dead-man's-switch sink"). If Alertmanager, vmalert or the whole monitoring VM dies, every alert stops and nobody is told. #565 showed the cost: notifications failed silently for weeks. `AlertmanagerDeliveryFailing` covers partial failure only. When every integration fails, it cannot reach anyone either. ## Goal A monitor outside the monitoring VM expects a regular Watchdog heartbeat and alerts on silence through a path that does not depend on Alertmanager. ## Options 1. **Timer on the services host.** It polls Alertmanager's API for an active `Watchdog`, or receives its webhook, and emails through the existing mail provider when the heartbeat is missing. No new service. Blind if both hosts die. 2. **Self-hosted Healthchecks on the services host.** Watchdog's webhook pings a check URL, and Healthchecks emails on a missed ping. One more container. Same both-hosts-down limit. 3. **An external heartbeat service outside the platform.** Survives both hosts. Must meet the hosting and privacy principles. ## Tasks - [x] Pick an option (state the trade-off in the issue). - [ ] Add the webhook to the `watchdog` receiver, and the monitor with its silence threshold (about 2 to 3 Watchdog repeat intervals). (dropped: option 1 was chosen, the existing probe polls the Alertmanager API) - [x] Test: stop Alertmanager, confirm the alert arrives within the threshold, start it again. - [x] Runbook: what the alert means and the first steps. Related: #565, #461.
supernaut ändrade titeln från monitoring: alert when the Watchdog heartbeat stops (external dead-man's switch) till monitoring: dead-man's switch does not cover Alertmanager death or total delivery failure 2026-10-17 21:22:08 +00:00
Upphovsperson
Ägare

Rescoped. An independent dead-man's switch already runs. bitborg-monitoring-probe on the services host checks VictoriaMetrics and ALERTS{alertname="Watchdog"} every 2 min and mails through Sweego directly, bypassing Alertmanager (runbook, monitoring probe section). Option 1 is therefore in place.

Remaining gaps:

  • Alertmanager down while VictoriaMetrics and vmalert are up. The alerts that would report it route through the dead Alertmanager.
  • Alertmanager up but every integration failing (the #565 failure mode).

Fix: extend the probe with an Alertmanager-up and delivery-failure check, plus a staleness rule for its metric.

Accepted limit: both hosts down at once is not covered. An external heartbeat would need a Swedish-hosted service. Not worth it now.

The watchdog receiver comments that mention an external dead-man's switch are corrected in the same change.

Rescoped. An independent dead-man's switch already runs. `bitborg-monitoring-probe` on the services host checks VictoriaMetrics and `ALERTS{alertname="Watchdog"}` every 2 min and mails through Sweego directly, bypassing Alertmanager (runbook, monitoring probe section). Option 1 is therefore in place. Remaining gaps: - Alertmanager down while VictoriaMetrics and vmalert are up. The alerts that would report it route through the dead Alertmanager. - Alertmanager up but every integration failing (the #565 failure mode). Fix: extend the probe with an Alertmanager-up and delivery-failure check, plus a staleness rule for its metric. Accepted limit: both hosts down at once is not covered. An external heartbeat would need a Swedish-hosted service. Not worth it now. The `watchdog` receiver comments that mention an external dead-man's switch are corrected in the same change.
Upphovsperson
Ägare

Verified live on 2026-10-18. After the #772 apply, alertmanager.service on the monitoring VM was stopped at 10:02 CEST. The probe logged BAD 1/3 and 2/3, then mailed "alertmanager DOWN" on the third run. After a restart it mailed "alertmanager RECOVERED". bitborg_monitoring_alertmanager_up went 1, 0, 1.

Verified live on 2026-10-18. After the #772 apply, `alertmanager.service` on the monitoring VM was stopped at 10:02 CEST. The probe logged BAD 1/3 and 2/3, then mailed "alertmanager DOWN" on the third run. After a restart it mailed "alertmanager RECOVERED". `bitborg_monitoring_alertmanager_up` went 1, 0, 1.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra#595
Ingen beskrivning angiven.