Repository navigation
feat(app): SLO alerts on the Alerts page - #3812
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 |
SLO burn alerts now read as such on the Alerts page: the source shows as "SLO" with the SLO page's icon, the rule shows as "Fast burn: if 2% of the error budget is spent within 1 hour", and the alert's name, the source link and "Edit" open its SLO, where its settings and history live. Deleting one says which burn alert of which SLO goes, and that the SLO keeps tracking. An SLO alert's detail page redirects to its SLO, and the source filter only offers SLO when SLOs are enabled. The shared alert types get the SLO source and, for SLO alerts, the SLO and the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
E2E Test Results✅ All tests passed • 474 passed • 1 skipped • 1126s
Tests ran across 4 shards in parallel. |
a108392 to
be95b8d
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
|
| if (alert.source === AlertSource.INLINE) { | ||
| return `/chart?alertId=${alert._id}`; | ||
| } | ||
| if (alert.source === AlertSource.SLO && alert.sloId) { |
There was a problem hiding this comment.
🟡 P2 — getAlertSourceUrl still links SLO alerts to /slos/:id when SLOs are turned off
With IS_SLOS_ENABLED false, this URL still drives the row name link (details off), the "Open SLO" menu item (details on), the history cards and the detail page's source icon. useSlosEnabledGuard in packages/app/src/slo.ts bounces that route to /search. Add IS_SLOS_ENABLED && to this branch, as ALERT_SOURCE_FILTER_OPTIONS already does.
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
| source => ({ value: source, label: getAlertSourceLabel({ source }) }), | ||
| ); | ||
| export const ALERT_SOURCE_FILTER_OPTIONS = Object.values(AlertSource) | ||
| .filter(source => source !== AlertSource.SLO || IS_SLOS_ENABLED) |
There was a problem hiding this comment.
🟡 P2 — Source filter hides SLO, but the URL parser still accepts ?source=slo
packages/app/src/AlertsPage.tsx:38 parses source with Object.values(AlertSource). With SLOs off, ?source=slo still filters the list, while the Select shows no matching option. Build the parser's allowed values from the same filtered list as ALERT_SOURCE_FILTER_OPTIONS.
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
8 finding(s): 🔴 0 P0/P1 · 🟡 5 P2 · 🔵 3 P3 2 posted as inline comment(s) on the changed lines. 3 listed below. 3 P3 folded at the bottom. Findings outside the changed lines
🔵 3 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. No P0/P1: the change is flag-gated ( 🟡 P2 — recommended
🔵 P3 nitpicks (6)
Reviewers (11): correctness, adversarial, kieran-typescript, julik-frontend-races, api-contract, testing, maintainability, project-standards, agent-native, learnings-researcher, previous-comments. 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
SLO burn alerts now read as such on the Alerts page: the source shows as
"SLO" with the SLO page's icon, the rule shows as "Fast burn: if 2% of the
error budget is spent within 1 hour", and the alert's name, the source link
and "Edit" open its SLO, where its settings and history live. Deleting one
says which burn alert of which SLO goes, and that the SLO keeps tracking.
An SLO alert's detail page redirects to its SLO, and the source filter only
offers SLO when SLOs are enabled. The shared alert types get the SLO
source and, for SLO alerts, the SLO and the rule.
Stack
Part 25 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: SLO alerts show on the Alerts page as plain alerts with an unknown source.
On this branch:
Test plan
AlertPropertiesSummary.test.tsx,AlertRowMenu.test.tsx,utils/__tests__/alerts.test.tsHow 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.
[ui-states: allow] No new empty, loading or error states here beyond the ones listed above.