feat(monitoring): alert gaps, inhibition rules and probe mail retry #703
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!703
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/monitoring-alerts"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
Eight monitoring changes, one commit each.
The cross-probe email now retries.
send_mailreturns non-zero when SMTP is unset or curl fails. The state file is written only after a delivered email.ServicesHostAgentSilent(critical, 10m) fires whenup{job="node",host="<services host>"}is absent. The host label is one variable,monitoring_services_host_label, shared by the agent role and the rules. The value is unchanged (bitborg-prod), so no series are renewed.Alertmanager inhibition rules. A silent services host holds back its per-service alerts. New
BackupVolumeUnmountedholds backBackup*Stale.test-alert-rules.pynow runsamtool check-configand fails on an inhibit matcher that names no alert.ReconcileEventPathSilentnow matches the systemdStarting bitborg-reconcile-kick.serviceline underuser@<bitborg_user_uid>.service. User units have nounitlabel of their own. The uid does not change with the OS user rename.RunnerControllerLoopFailingandRunnerControllerStalledread the controller textfile. The controller container joinsmonitoring_core_units. The stale comment aboutqueued_jobs=-1is corrected.VacuousAlertRulefires when a rule'sseries_fetchedis 0 for 30m. The rule name is copied to arulelabel because the alert's ownalertnamereplaces the series label.ServicesHostAgentSilentinhibitsVacuousAlertRule, which would otherwise fire about 30 times when the agent is silent.test-alert-rules.pyevaluates the inhibit rules against label sets, including this pair.alert_vacuity_exemptholdsServicesHostAgentSilent, which fetches nothing while it fires.RenovateStalereads the last-run timestamp (limitalert_renovate_max_age_hours, 48).ForgejoMissingTranslationis a Loki rule. It excludes therelativetime.*plural-form lookups, which Forgejo logs about 100k times a day.The Alertmanager scrape job and
AlertmanagerDeliveryFailingalready exist (#593), so #461 needed only the inhibition rules.Verification
check-alert-rules.py(and--self-test),test-alert-rules.py,test-monitoring-probe.py: pass.ServicesHostAgentSilentandBackupVolumeUnmounted(fires, quiet). The probe test stubscurlfor six send/state cases and fails on the old script.absent(up{job="node",host="bitborg-prod"})returns nothing, and returns one series for a wrong host. Same for theBackupVolumeUnmountedexpression with the real and a wrong mountpoint.VacuousAlertRulefinds 0 vacuous rules and 33 with== 1.ForgejoMissingTranslationmatches 0 lines in 15m, 1582 without the exclusion.--syntax-checkpass.A failed cross-probe mail makes
bitborg-monitoring-probe.serviceexit non-zero on each retry tick. This is intended and documented in the runbook. No alert is added for it.Not verified
ForgejoMissingTranslationcannot fire on today's data, so only the line filters are tested.Apply
monitoringrestarts vmalert, Alertmanager and reloads the Loki rules.monitoring-agentrewrites the probe script and the unit-metrics script (runner controller is a new core unit).Closes #609
Closes #605
Closes #461
Closes #580
Closes #602
Closes #444
Closes #330
Closes #335
ServicesHostAgentSilent fires when up{job="node"} for the services host is absent for 10m. The staleness rules return nothing without their series, so they cannot cover a dead agent. The host label is now one variable shared by the agent role and the rules. Closes #605e7474026f77c05cebaaa