Repository navigation
Commit f8defc5
fix(alerting): KeycloakRealmBackupStale fires NoData spuriously (#559) (#28)
VERDICT: conversion artifact, NOT a real stale backup. The keycloak-dr-backup
CronJob is healthy (every 6h, last runs Complete, latest S3 aws-sso realm
export ~80m old, metric last sample ~6m ago).
Root cause: keycloak_backup_* is PUSHED once per 6h run, so it's present only
within VM's ~5m instant-staleness window — empty for ~5h55m of every cycle. The
VMRule's `(time()-max(...) > 26h) or absent_over_time([26h])` returns a series
only when firing; vmalert treats an empty result as OK, but the verbatim
Grafana port turns the healthy empty result into NoData -> no_data_state=Alerting
-> a spurious ticket/page every inter-push gap.
Fix: query A now = `time() - max_over_time(keycloak_backup_last_success_timestamp_seconds{realm="aws-sso"}[26h])`
(the real age, tolerant of the sparse push), threshold C `> 93600` (26h), and
NoData (no sample in 26h at all = backup genuinely stopped) keeps
no_data_state=Alerting. This reproduces both original clauses without the
spurious fire. relative_time_range.from raised to 94320 to cover the 26h lookback.
The other two converted rules (cert-expiry, tailscale) query continuously-scraped
metrics, so they don't hit this and are unchanged.
Refs thunderbird/platform-infrastructure#559, #367.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7a9767e commit f8defc5
1 file changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
58 | | - | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
64 | | - | |
| 74 | + | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| |||
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
100 | | - | |
| 110 | + | |
101 | 111 | | |
102 | 112 | | |
103 | 113 | | |
| |||
0 commit comments