Skip to content

feat(app): SLO list page behind NEXT_PUBLIC_ENABLE_SLOS - #3801

Open
alex-fedotyev wants to merge 1 commit into
alex/HDX-3001-slo-13-mcp-writefrom
alex/HDX-3001-slo-14-app-list
Open

alex-fedotyev wants to merge 1 commit into
alex/HDX-3001-slo-13-mcp-writefrom
alex/HDX-3001-slo-14-app-list

Conversation

@alex-fedotyev

@alex-fedotyev alex-fedotyev commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an SLOs page to the nav (beta, cloud only) when
NEXT_PUBLIC_ENABLE_SLOS is true; with the flag off, the route goes to
Search. The page lists the team's SLOs worst first, with the state, SLI,
error budget left, burn rate and target each SLO stores, and polls them
every minute. A summary counts the SLOs in each state, and a count filters
the list to that state. An SLO without a stored status yet shows as
pending.

Stack

Part 14 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 on main, one squashed commit each. Each diff is only its own change, and CI runs as if each PR targets main.

  1. feat(common-utils): SLO definition schema #3788 common-utils: SLO definition schema
  2. feat(common-utils): SLO fast and slow burn rules #3789 common-utils: SLO fast and slow burn rules
  3. feat(common-utils): SLO alert targets and status types #3790 common-utils: SLO alert targets and status types
  4. feat(common-utils): SLO counts query #3791 common-utils: SLO counts query
  5. feat(common-utils): SLO stats and state #3792 common-utils: SLO stats and state
  6. feat(common-utils): SLO history and ordering #3793 common-utils: SLO history and ordering
  7. feat(api): SLO definitions behind ENABLE_SLOS #3794 api: SLO definitions behind ENABLE_SLOS
  8. feat(api): refresh SLO statuses in the check-alerts task #3795 api: refresh SLO statuses in the check-alerts task
  9. feat(api): SLO burn alerts as their own alert source #3796 api: SLO burn alerts as their own alert source
  10. feat(api): keep SLO alerts out of the external alerts API #3797 api: keep SLO alerts out of the external alerts API
  11. feat(api): evaluate SLO burn alerts and notify #3798 api: evaluate SLO burn alerts and notify
  12. feat(api): clickstack_get_slo MCP tool #3799 api: clickstack_get_slo MCP tool
  13. feat(api): SLO preview, save and delete MCP tools #3800 api: SLO preview, save and delete MCP tools
  14. feat(app): SLO list page behind NEXT_PUBLIC_ENABLE_SLOS #3801 app: SLO list page behind NEXT_PUBLIC_ENABLE_SLOS (this PR)
  15. feat(app): search, filter, sort and delete SLOs in the list #3802 app: search, filter, sort and delete SLOs in the list
  16. feat(app): SLO builder for a new SLO #3803 app: SLO builder for a new SLO
  17. feat(app): SLO objective, details and editing in the builder #3804 app: SLO objective, details and editing in the builder
  18. feat(app): eligible-event filters and the latency template in the builder #3805 app: eligible-event filters and the latency template in the builder
  19. feat(app): preview an SLO in the builder before saving it #3806 app: preview an SLO in the builder before saving it
  20. feat(app): create an SLO from a search, and duplicate an SLO #3807 app: create an SLO from a search, and duplicate an SLO
  21. feat(app): SLO detail page #3808 app: SLO detail page
  22. feat(app): bad events flyout on the SLO page #3809 app: bad events flyout on the SLO page
  23. feat(app): SLI, error budget and burn rate charts on the SLO page #3810 app: SLI, error budget and burn rate charts on the SLO page
  24. feat(app): fast and slow burn alerts in the SLO builder, list and page #3811 app: fast and slow burn alerts in the SLO builder, list and page
  25. feat(app): SLO alerts on the Alerts page #3812 app: SLO alerts on the Alerts page
  26. feat(app): group-by in the SLO builder #3813 app: group-by in the SLO builder
  27. feat(app): grouped SLOs in the list and on the SLO page #3814 app: grouped SLOs in the list and on the SLO page

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) and NEXT_PUBLIC_ENABLE_SLOS (app), both off by default.

Screenshots or video

Before After
before, the nav without SLOs, light after, the SLO list, light
after, the SLO list, dark

How to reproduce

Starting point: yarn dev on this branch (the pages need the API). .env.development turns on ENABLE_SLOS and NEXT_PUBLIC_ENABLE_SLOS (parts 7 and 14). Use a trace or log source with data; the demo server works.

On main: there are no SLO pages.

On this branch:

  1. Open SLOs in the nav (marked beta). SLOs created with the API or MCP show worst first, with their state, SLI, budget left, burn rate and target.
  2. Click a state count above the table: the list shows only that state.

Test plan

  • states: empty (no SLOs yet), loading (skeleton) and error (alert with Retry), checked by stubbing the list request
  • viewport: checked at 1440 px and in a narrow 900 px window. The list scrolls sideways and its toolbar wraps, the builder's preview moves under the form, and the SLO page's stats wrap to two columns.
  • app typecheck, lint and knip at this commit

How to test on Vercel preview

N/A: SLOs need the API, and the preview runs in local mode, where they are off.

References

  • Linear Issue: HDX-3001
  • Related PRs: the rest of this stack, listed above

[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.

[as-cast: allow] The cast check matches the word "as" in comments and strings here; the diff has no as casts.

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1144db1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 24, 2026 7:01pm UTC
hyperdx-storybook Ready Ready Preview Nov 24, 2026 7:01pm UTC

Request Review

This was referenced Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Duplicate code analysis

1 new clone introduced by this PR.

  • packages/api/src/routers/external-api/v2/alerts.ts:908-925 ↔ packages/api/src/routers/external-api/v2/alerts.ts:1181-1197 — 18 lines

If one of these duplicates a helper that already exists, import it instead
of redefining it. If the duplication is deliberate, ignore this comment —
the check is advisory and never fails the build.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 108 in total (1.11%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 475 passed • 1 skipped • 1122s

Status Count
✅ Passed 475
❌ Failed 0
⚠️ Flaky 13
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

Adds an SLOs page to the nav (beta, cloud only) when
NEXT_PUBLIC_ENABLE_SLOS is true; with the flag off, the route goes to
Search. The page lists the team's SLOs worst first, with the state, SLI,
error budget left, burn rate and target each SLO stores, and polls them
every minute. A summary counts the SLOs in each state, and a count filters
the list to that state. An SLO without a stored status yet shows as
pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 466 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Production files changed: 9
  • Production lines changed: 466
  • Branch: alex/HDX-3001-slo-14-app-list
  • Author: alex-fedotyev

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

6 finding(s): 🔴 0 P0/P1 · 🟡 4 P2 · 🔵 2 P3

None could be anchored to changed lines; they are listed below. 2 P3 folded at the bottom.

Findings outside the changed lines

  • 🟡 P2 packages/app/src/components/Slos/SlosListPage.tsx:354 — Active state filter can lose its button, leaving no way to clear it → Always render the button for the active stateFilter, even when its count is 0 (.filter(s => counts.get(s) || s === stateFilter)), or add a clear control in the 'No matching SLOs' empty state. Today only states with a non-zero count get a button. Example: the user clicks '1 burning', and on the next 60 s poll that SLO recovers. The burning button disappears, the list shows 'No matching SLOs', and the only way out is editing ?state= in the URL. The same thing happens when someone opens a shared ?state=breached link while nothing is breached.
  • 🟡 P2 packages/app/src/components/Slos/SloTable.tsx:189 — State badge sits inside two tooltips, so two open at once on hover → Keep one tooltip. SloStateBadge already wraps its badge in a Tooltip showing the state description, and SloRow wraps that again in a second Tooltip (updated time or error). Hovering the badge opens both, stacked. Either merge the two texts into one label, or add an option to SloStateBadge that turns its own tooltip off here.
  • 🟡 P2 packages/app/src/components/Slos/sloUtils.ts:463 — formatSli shows '100.000%' for an SLI below 1 → For example, sli = 0.999999 gives pct 99.9999, and toFixed(3) turns that into '100.000%'. The UI then claims a perfect SLI when there were bad events, which the comment two lines up says should not happen. Round down instead (Math.floor(pct * 1000) / 1000), or cap the result at '99.999%' whenever sli < 1.
  • 🟡 P2 packages/app/src/components/Slos/SlosListPage.tsx:387 — Filtered empty state tells the user to adjust a search that doesn't exist → This PR's page has no search box (search arrives in feat(app): search, filter, sort and delete SLOs in the list #3802), only the state filter. Change the description to something like 'No SLOs are in this state.', and give it a button that clears stateFilter.
🔵 2 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/components/Slos/sloUtils.ts:458 — New formatting and state helpers have no unit tests → Add a sloUtils.test.ts covering formatSli (exactly 1, values just under 1, 99.99 and 99 cutoffs), formatBudget (negative/overspent, below 10%), formatBurnRate (10 and 100 cutoffs) and budgetColorVar thresholds. Nothing tests these cutoffs now, and the '100.000%' rounding bug above shows why they need it.
  • 🔵 P3 packages/app/src/components/AppNav/AppNav.tsx:103 — cloudOnly: true on the SLOs nav link has no effect → Remove it. IS_SLOS_ENABLED in packages/app/src/config.ts already includes && !IS_LOCAL_MODE, so the link never exists in local mode, and the cloudOnly filter at AppNav.tsx:510 never has anything to remove.

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.

@github-actions

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

This is an app-only, feature-flagged (NEXT_PUBLIC_ENABLE_SLOS, off by default, cloud-only) read/list surface. Nothing in the diff introduces data loss, auth bypass, injection, or a guaranteed happy-path crash. The findings below are reliability and quality recommendations.

🟡 P2 — recommended

  • packages/app/src/components/Slos/SlosListPage.tsx:88 — A valid state filter with zero matching SLOs (direct/bookmarked URL, or a state whose count drops to 0 during the 60s poll) strands the user on the "No matching SLOs" empty state with no in-UI way to clear it, because filter chips only render for states with a nonzero count and the clear action only fires on the active state's own chip.
    • Fix: Always render a chip for the active filter even at count 0, or add an explicit clear/"All" control to the empty state, or reset stateFilter to null when the active state yields no rows.
    • adversarial, frontend-races, correctness
  • packages/app/src/components/Slos/SloTable.tsx:87 — The state cell wraps SloStateBadge in a Tooltip (freshness/error text) while SloStateBadge already wraps the same element in its own Tooltip (state description), so two Mantine tooltips target one trigger and one set of content is effectively dead or conflicting.
    • Fix: Consolidate to a single tooltip owner — fold the freshness/error text into the badge's tooltip, or drop the badge's internal tooltip and let callers supply the label.
    • maintainability
  • packages/app/src/components/Slos/SloTable.tsx:92 — formatDistanceToNowStrict(new Date(status.evaluatedAt)) is unguarded and the response is consumed via an unchecked cast (hdxServer('slos').json<SloApiResponse[]>() with no runtime parse); a missing or unparseable evaluatedAt yields an Invalid Date that throws during render, and with no error boundary on this surface the whole page (including nav) white-screens.
    • Fix: Validate the date before formatting (fall back to a static label when getTime() is not finite), or wrap the list in an error boundary.
    • adversarial, kieran-typescript
  • packages/app/src/components/Slos/sloUtils.ts:1 — The new pure formatters (formatSli, formatBudget, formatBurnRate, formatTarget, budgetColorVar, getSloDisplayState) carry non-trivial threshold and null-handling branches but have no unit tests, despite an established src/__tests__ convention for equivalent utils.
    • Fix: Add a sloUtils unit test covering the boundary branches (e.g. formatSli at 1, ≥99.99, ≥99, null; formatBudget sign/fraction-digit thresholds; formatBurnRate ≥100/≥10/<10; budgetColorVar thresholds).
    • testing, kieran-typescript, maintainability, project-standards, correctness
🔵 P3 nitpicks (3)
  • packages/app/src/components/Slos/sloUtils.ts:60 — For an SLI in [0.999995, 1), toFixed(3) rounds up to "100.000%", displaying a non-perfect SLI as a perfect one and masking that bad events exist.
    • Fix: Floor the displayed value rather than rounding, or clamp a value that rounds to 100 while sli < 1 down to 99.999%.
  • packages/app/src/components/Slos/sloUtils.ts:20 — The sloStateLabel/sloStateDescription switches and the SloStateBadge IIFE switch have no default/satisfies never guard, and SLO_DISPLAY_STATES is hand-maintained; since the app tsconfig does not enable noImplicitReturns, a future SloState member would silently return undefined/render blank and drop out of the filter list, diverging from the codebase's existing exhaustiveness convention.
    • Fix: Add a const _exhaustive: never = state default branch to each switch and derive SLO_DISPLAY_STATES from the shared SloState source.
  • packages/app/src/components/Slos/SlosListPage.tsx:64 — The wrapper divs use raw style={{ display: 'flex', flexDirection: 'column', minHeight: '100%' }} rather than the preferred Mantine layout component/style props.
    • Fix: Express the layout with a Mantine Flex/style props (e.g. direction="column", mih="100%", flex={1}), matching the documented preference.

Reviewers (10): correctness, adversarial, testing, maintainability, project-standards, kieran-typescript, frontend-races, agent-native, learnings-researcher, previous-comments.

Testing gaps:

  • No unit coverage for sloUtils formatters or the IS_SLOS_ENABLED flag/local-mode branch in config.ts.
  • The Playwright e2e webserver does not set NEXT_PUBLIC_ENABLE_SLOS, so the new data-testids (slos-page, slo-table, slo-row, slo-state-*) are unreachable in e2e; enable the flag there if e2e coverage is intended.
  • No test exercises the stranded-filter path, the direct-URL redirect guard (useSlosEnabledGuard → /search), or the error-state render when a poll fails after a successful empty load.

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

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 1144db19 Deployed Nov 24, 2026 by vercel[bot]
Preview – hyperdx-storybook — 1144db19 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant