Skip to content

Stop repeating persistent failure alerts and digest routine ones - #10

Merged
leonacostaok merged 1 commit into
mainfrom
fix/alert-dedup-digest
Oct 14, 2026
Merged

leonacostaok merged 1 commit into
mainfrom
fix/alert-dedup-digest

Conversation

@leonacostaok

Copy link
Copy Markdown
Member

Production sent 380 monitor-failure emails between Oct 13 14:00 and Oct 14 11:34 UTC for one condition: the KMS status receipt stayed stale while scheduled issuance was blocked. enqueue_failure only deduplicated while an occurrence was pending, so each delivered one was followed by a new one on the next check.

  • State remembers active failures (activeFailures). The same failure is queued again at most once a day while it persists; a successful check clears it.
  • Critical alerts (severity error, which covers every monitor failure, and tls-regression) still go out immediately, one per message.
  • Other alerts wait until the oldest has been pending an hour, then go out as one digest (up to 20). The digest has its own durable record, member list and idempotency key, keeps its members fixed until resolved, and acknowledges all of them on confirmed delivery.
  • Alerts now carry queuedAt; older alerts without it are treated as due.

Tests: full suite 181 run, 180 pass, 1 skip (pinned qScan integration, which CI runs). New tests cover the persistent-failure dedup and daily reminder, the hourly digest with fixed members, and critical alerts bypassing the digest.

A failure that persisted (a stale KMS status receipt) was queued again on
every check once its previous occurrence was delivered, so one condition sent
380 emails in a day. Remember active failures and re-queue the same failure at
most once a day until a successful check clears it.

Send critical alerts (severity error, tls-regression) at once as before. Hold
the rest until the oldest has waited an hour, then deliver them as one digest
with its own durable receipt that acknowledges every member together.
@leonacostaok
leonacostaok merged commit 73d8c7c into main Oct 14, 2026
1 check passed
@leonacostaok
leonacostaok deleted the fix/alert-dedup-digest branch October 14, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant