feat(monitoring): keycloak lockout alert and alert rule unit tests #640
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!640
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/keycloak-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
Finishes the monitoring checklist of #573. Scrape, probe, unit-active and
KeycloakMemoryHighwere already merged (#601, #638).KeycloakLoginLockouts(Loki): more than 20user_temporarily_disabledoruser_permanently_disabledlogin errors in 10 min, read from the realm'sjboss-loggingevents. Thresholds are role defaults.SignupProvisioningFailingmatches[signup] Kanidmand/or[signup] Keycloak, followingkanidm_enabledandkeycloak_enabled. Kanidm keeps working until cutover.scripts/test-alert-rules.py:vmalert-tool unittestforKeycloakNotReady,KeycloakMemoryHighandCoreUnitDown(keycloak). The Loki rules are LogQL, which no tool unit tests, so the script matches each rendered line filter against sample lines (KeycloakOOMKilled,KeycloakLoginLockouts,SignupProvisioningFailingfor both IdPs). Fixture:ansible/roles/monitoring/tests/alert-rules.test.yml. New CI step besidecheck-alert-rules.py.Deliberate differences from the checklist
MemoryHighis 87.5 %, where the kernel throttles, so 90 % could never be reached for 10 min.HealthStartPeriod, andstartingreads as 0, so 2 min would fire on every restart.keycloak_enabled/kanidm_enabled(#638). No change.Test
./scripts/check-alert-rules.pyand--self-test: pass../scripts/test-alert-rules.py: pass. Withalert_keycloak_memory_pctraised to 90 the memory test fails, so the tests can fail.Not proven
container="keycloak"label come from Keycloak docs and the existing Loki rules, not from a captured line. Provoke 11 bad passwords on a seed user on staging and read the line in Loki. Prod Prometheus has no Keycloak series yet (not applied).Refs #573. The lockout matcher still needs a live check on staging.
9dc5352065ea11843539