Repository navigation
Send an alert of a retried fault only when its rows come in a crowd (0.8.0) - #24
Merged
Merged
Conversation
A rule may now say `burst: { count, seconds }`: its alert goes only from the batch that takes a
window to `count` rows of its kind, from every server together, and once a window, saying how many
the window holds. The cool-down then applies as to any alert. A live game's storage writes were
refused for a moment by the platform a few times a day and each refusal was retried and landed,
yet every one of them raised a critical message; one is noise, a hundred in ten minutes is an
outage, and only the second is worth the owner's phone.
The window is a row of `alert_state` under `burst:<key>` (its start in `sent_at`, its rows in
`held`), written by one upsert as the cool-down's is and pruned with it, so no migration is added.
`alertsFor` hands the burst and the batch's row count on with the alert. A count or seconds that is
not a whole number above zero throws as the Worker loads. Released as 0.8.0.
Checked: lefthook run pre-commit --all-files, every gate clean (lockfile, format, lint, file-size,
strict-mode, english-only, worker, types); npm test, 96 tests pass, 2 of them new; the crossing
condition mutated to `held >= count` failed the burst test (a second message in one window) and
was restored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A rule may say
burst: { count, seconds }: its alert goes only from the batch that takes a window tocountrows of its kind, from every server together, once a window, saying(N within S s); the cool-down then applies as to any alert. For a fault that is expected now and then and retried by itself (a storage write refused for a moment): noise alone, an outage in a crowd.The window is a row of
alert_stateunderburst:<key>, written by one upsert as the cool-down's is and pruned with it: no migration. Released as 0.8.0 (README, CHANGELOG, dist).Checked:
lefthook run pre-commit --all-filesclean;npm test96 pass, 2 new; the crossing condition mutated toheld >= countfailed the burst test and was restored.🤖 Generated with Claude Code