Repository navigation
feat(common-utils): SLO fast and slow burn rules - #3789
alex-fedotyev wants to merge 1 commit into
Conversation
Adds the two burn checks an SLO is judged by: fast burn, when 2% of the window's error budget is spent within an hour, and slow burn, when 5% is spent within 6 hours. Each also needs a short window, a twelfth of the long one, to burn as fast, so it stops holding soon after a burn stops, and a minimum of events. The burn rate threshold follows from the SLO window (14.4x and 6x for 30 days, 3.36x and 1.4x for 7 days), so both windows alert on the same share of their budget. describeSloAlertRule gives each rule as one sentence, for the builder, the Alerts page, notifications and MCP to share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
E2E Test Results✅ All tests passed • 478 passed • 1 skipped • 1187s
Tests ran across 4 shards in parallel. |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
PR Review
4 finding(s): 🔴 0 P0/P1 · 🟡 0 P2 · 🔵 4 P3 No inline comments. 4 P3 folded at the bottom. 🔵 4 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a small, additive, pure-logic change to 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, learnings-researcher. Testing gaps: No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
Summary
Adds the two burn checks an SLO is judged by: fast burn, when 2% of the
window's error budget is spent within an hour, and slow burn, when 5% is
spent within 6 hours. Each also needs a short window, a twelfth of the
long one, to burn as fast, so it stops holding soon after a burn stops,
and a minimum of events. The burn rate threshold follows from the SLO
window (14.4x and 6x for 30 days, 3.36x and 1.4x for 7 days), so both
windows alert on the same share of their budget. describeSloAlertRule
gives each rule as one sentence, for the builder, the Alerts page,
notifications and MCP to share.
Stack
Second of 27 PRs in a GitHub stack (stack #3815). The header says this PR merges into the branch below it, but the stack's base is
main: merging a PR lands it and every PR below it onmain, one squashed commit each. Each diff is only its own change, and CI runs as if each PR targetsmain.Parts 1 to 6 are shared code, 7 to 13 the API and its MCP tools, and 14 to 27 the app. Everything ships behind
ENABLE_SLOS(API) andNEXT_PUBLIC_ENABLE_SLOS(app), both off by default.How to reproduce
Starting point: a checkout of this branch.
On
main: nothing to compare; this is new code.On this branch:
cd packages/common-utils && npx jest src/core/__tests__/slo.test.ts: the thresholds per window (14.4x and 6x for 30 days, 3.36x and 1.4x for 7 days) and the one-sentence rule descriptions are covered.Test plan
core/__tests__/slo.test.ts(thresholds per window, rule sentences)How to test on Vercel preview
N/A, non-UI change.
References
[no-changeset: allow] The changeset for this piece is in part 6.
[as-cast: allow] The cast check matches the word "as" in comments and strings here; the diff has no
ascasts.