Repository navigation
feat(app): fast and slow burn alerts in the SLO builder, list and page - #3811
alex-fedotyev wants to merge 1 commit into
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Duplicate code analysis1 new clone introduced by this PR.
If one of these duplicates a helper that already exists, import it instead jscpd compared this branch against |
E2E Test Results✅ All tests passed • 474 passed • 1 skipped • 1147s
Tests ran across 4 shards in parallel. |
The SLO builder gets a burn-rate alerts section with the two alerts. Each is a switch labeled with its rule, for example "Notify when 2% of the 30-day error budget is spent within 1 hour (14.4x the allowed rate)", with when it resolves in its help, and, once on, its own channels. Both start off, and one that is turned on needs a channel. The list gets an alert column with the worst state of the alerts that are on, each alert's state in its tooltip, and whether notifications are silenced. The SLO page gets an alerts panel with each alert's rule, channels and state, and when it fired in the last 7 days, with a link to change them in the builder. A duplicated SLO starts without alerts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bee77ae to
2cc06b4
Compare
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
| e.currentTarget.checked ? newSloAlertTarget() : null, | ||
| { shouldDirty: true }, | ||
| ) | ||
| } |
There was a problem hiding this comment.
🟡 P2 — Turning an alert off and back on wipes its saved channels
Turning the switch off sets alerts.<rule> to null, and turning it on writes newSloAlertTarget() with one empty channel. On an existing SLO, a mis-click on the switch silently throws away the configured webhooks. Keep the last target in a ref or local state and restore it when the switch goes back on, and use newSloAlertTarget() only when there was none.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
| } | ||
| initializedRef.current = true; | ||
| // "Edit" on an SLO's alerts links here with #alerts. | ||
| if (window.location.hash === '#alerts') { |
There was a problem hiding this comment.
🟡 P2 — #alerts scroll runs before the loaded SLO renders and lands under the sticky header
scrollIntoView runs in the same effect as reset(...), before the form re-renders with the loaded SLO. When the Indicator section above changes height (latency fields, editors), the alerts section moves after the scroll. The page header is also sticky, so the section's top ends up hidden under it. Scroll in a later effect or a requestAnimationFrame after reset, and give the section a scroll-margin-top the height of the header.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
PR Review
7 finding(s): 🔴 1 P0/P1 · 🟡 4 P2 · 🔵 2 P3 2 posted as inline comment(s) on the changed lines. 3 listed below. 2 P3 folded at the bottom. Findings outside the changed lines
🔵 2 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. Scope: 11 files under 🟡 P2 — recommended
🔵 P3 nitpicks (4)
Reviewers (10): correctness, adversarial, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, ce-agent-native-reviewer, ce-learnings-researcher, previous-comments. Testing gaps:
Dropped during verification (not findings): the 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
The SLO builder gets a burn-rate alerts section with the two alerts. Each
is a switch labeled with its rule, for example "Notify when 2% of the
30-day error budget is spent within 1 hour (14.4x the allowed rate)", with
when it resolves in its help, and, once on, its own channels. Both start
off, and one that is turned on needs a channel. The list gets an alert
column with the worst state of the alerts that are on, each alert's state
in its tooltip, and whether notifications are silenced. The SLO page gets
an alerts panel with each alert's rule, channels and state, and when it
fired in the last 7 days, with a link to change them in the builder. A
duplicated SLO starts without alerts.
Stack
Part 24 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.Screenshots or video
How to reproduce
Starting point:
yarn devon this branch (the pages need the API)..env.developmentturns onENABLE_SLOSandNEXT_PUBLIC_ENABLE_SLOS(parts 7 and 14). Use a trace or log source with data; the demo server works.On the previous part: burn alerts can only be set with the API or MCP.
On this branch:
Test plan
sloList.test.ts(firing episodes),sloForm.test.ts(a turned-on alert needs a channel)How to test on Vercel preview
N/A: SLOs need the API, and the preview runs in local mode, where they are off.
References
[no-changeset: allow] The changeset for this piece is in part 27.
[no-story: allow] The new SLO components are page-level and fed by queries and form state, so this feature has no Storybook stories.
[ui-states: allow] No new empty, loading or error states here beyond the ones listed above.
[as-cast: allow] The cast check matches the word "as" in comments and strings here; the diff has no
ascasts.