feat(monitoring): alert on identity projection failures and refused account creation #347
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
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!347
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/identity-projection-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?
Closes #326. Part of the identity-validation epic.
Two identity failure modes were unalertable.
1. Projection failures were reported under the wrong name. A refused identity write raised the
Actions enforcement gauge, so the alert that fired said the reconciler was not applying CI tier
enforcement and sent the operator after a token scope. The reconciler now publishes its own signal;
this adds the rule that keys on it.
Three properties of that metric shaped the rule, and each is easy to get wrong:
_totalsuffix. The condition keyson the degraded gauge alone and the count appears only in the annotation, labelled as such. No
rate()orincrease()anywhere. The idiom that would carry the count into$valuewasdeliberately not used: it makes the alert silently unfirable if the two series ever diverge, and
firing reliability beats a tidier summary.
for:isgenerous, matching its sibling, and the annotation tells the operator to fix the value, not to
retry or restart.
is true by construction and it stays quiet during an unrelated outage, which the deadman and status
alerts already own. The vector match was verified against production using the existing equivalent
pair before committing to it. The residual cost — the window restarts after an outage, delaying
re-fire on a sticky condition — is stated in the file comment.
2. Refused account creation at first sign-in was watched by nothing. If a name is valid at the
identity provider but reserved on the git host, creation fails as a 500: the portal is not in the
request, the reconciler cannot see an account that was never created, and no metric moves. Adds a
log-based rule; one occurrence is one locked-out user.
Production is clean — 14 days and 1.9 M lines scanned, no match — so the matcher is derived from
upstream 16.0.1 by tracing the actual path: the OAuth callback creates users with an empty template
name, which routes every creation error to the server-error branch, which logs at
[E]with thehandler name. The account-linking handler is included too, because linking is enabled, so a collision
fails the person out identically on the same request.
Verification
Both rules validated against rendered output, not the template.
vmalert -dryRunat the pinnedproduction version reports 42 rules, exit 0;
promtool check rulesagrees and additionally validatesthe annotation templates. For the log rule, the real ruler was run in a throwaway container at the
pinned version — it loaded the group and evaluated the query, returning 200.
Prettier and markdownlint clean.
57420f94bb4a0d2392330d24e569790c3f28b902