fix(monitoring): probe mails when alertmanager or delivery is down #772

Sammanfogat
supernaut sammanfogade 2 incheckningar från fix/probe-alertmanager-down in i main 2026-10-17 21:54:23 +00:00
Ägare

The services-host probe already works as a dead-man's switch for VictoriaMetrics and vmalert. This covers the two gaps left (#595):

  • Alertmanager down. up{job="alertmanager"} absent or 0 for 3 runs mails "alertmanager DOWN" through Sweego, bypassing Alertmanager. It sends a RECOVERED mail when it comes back.
  • Total delivery failure. Failed notifications in 30 min with no successes trigger the same mail. A partial failure or no traffic does not.

Details

  • A VictoriaMetrics query error skips the run and leaves the fail count alone.
  • New textfile metrics bitborg_monitoring_alertmanager_up and bitborg_monitoring_alertmanager_delivering, plus the AlertmanagerProbeMetricStale rule.
  • The watchdog receiver comments no longer claim an external switch is missing.
  • Runbook: the third check, and a manual test (stop alertmanager.service, expect mail in about 6 min, restart, expect RECOVERED).

Tests

  • vmalert-tool runs the real delivery query in three cases: idle, partial failure and total failure.
  • scripts/test-monitoring-probe.py: 18 cases, including a failed query and the .prom values.

Accepted limit

Both hosts down at once is not covered.

Closes #595

The services-host probe already works as a dead-man's switch for VictoriaMetrics and vmalert. This covers the two gaps left (#595): - **Alertmanager down.** `up{job="alertmanager"}` absent or 0 for 3 runs mails "alertmanager DOWN" through Sweego, bypassing Alertmanager. It sends a RECOVERED mail when it comes back. - **Total delivery failure.** Failed notifications in 30 min with no successes trigger the same mail. A partial failure or no traffic does not. ## Details - A VictoriaMetrics query error skips the run and leaves the fail count alone. - New textfile metrics `bitborg_monitoring_alertmanager_up` and `bitborg_monitoring_alertmanager_delivering`, plus the `AlertmanagerProbeMetricStale` rule. - The `watchdog` receiver comments no longer claim an external switch is missing. - Runbook: the third check, and a manual test (stop `alertmanager.service`, expect mail in about 6 min, restart, expect RECOVERED). ## Tests - vmalert-tool runs the real delivery query in three cases: idle, partial failure and total failure. - `scripts/test-monitoring-probe.py`: 18 cases, including a failed query and the `.prom` values. ## Accepted limit Both hosts down at once is not covered. Closes #595
supernaut lade till 2 incheckningar 2026-10-17 21:49:05 +00:00
Third probe check: Alertmanager up per VictoriaMetrics, and not failing every notification over 30 min. Own state, fail count, textfile metrics and staleness rule. Fixes stale wording that said the watchdog receiver feeds an external switch.

Refs #595
test(monitoring): cover probe delivery query, skip alertmanager check on query error
En del kontroller misslyckades
ci / ci (pull_request) Has been cancelled
0393e66037
Refs #595
supernaut tvångsskickade fix/probe-alertmanager-down från 0393e66037
En del kontroller misslyckades
ci / ci (pull_request) Has been cancelled
till 01a86579be
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m53s
2026-10-17 21:51:00 +00:00
Jämför
supernaut schemalade den här ändringsförfrågan för automatisk sammanfogning när alla kontroller lyckas 2026-10-17 21:51:04 +00:00
supernaut sammanfogade incheckning 26fe6387e1 till main 2026-10-17 21:54:23 +00:00
supernaut tog bort grenen fix/probe-alertmanager-down 2026-10-17 21:54:23 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
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!772
Ingen beskrivning angiven.