Skip to content

feat(app): grouped SLOs in the list and on the SLO page - #3814

Open
alex-fedotyev wants to merge 1 commit into
alex/HDX-3001-slo-26-app-group-builderfrom
alex/HDX-3001-slo-27-app-groups
Open

alex-fedotyev wants to merge 1 commit into
alex/HDX-3001-slo-26-app-group-builderfrom
alex/HDX-3001-slo-27-app-groups

Conversation

@alex-fedotyev

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

Copy link
Copy Markdown
Contributor

Summary

A grouped SLO expands into its tracked groups in the list, worst first,
each with its state, SLI, budget left and burn rate, and a note when more
groups have too few events to be tracked. A group with fewer than 100
eligible events in the window shows as "Too few events" and does not
alert. The SLO page shows all groups together or one group, picked from a
menu or a link (?group=, which group rows and alert notifications use);
its numbers, charts and bad events follow the group. With all groups, the
state is the worst group's. The definition panel names the group-by and
how many groups there are, and the recent firings count when any group was
firing.

Stack

Part 27 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
  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 (this PR)

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 list, light after, the groups, light
after, the groups, dark
before, the SLO page, light after, one group, light
after, one group, dark

Follow-ups

Listed on HDX-3001 for the team to prioritize: external API support for SLOs (with docs and tests), a docs page, counts stored per bucket so the window query is incremental, calendar windows and reports, a dashboard tile, editable burn thresholds with a slower ticket-style alert, and an end-to-end test of the SLO pages.

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 the previous part: a grouped SLO shows as one row and one page.

On this branch:

  1. In the list, expand a grouped SLO: its groups show worst first, with a note when more groups are not tracked.
  2. Click a group: the SLO page opens on it (?group=), and the menu next to the state switches groups or shows all.

Test plan

  • states: a group with too few events shows "Too few events"; a grouped SLO before its first update says its groups show after it
  • 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-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] The group views reuse the empty, loading and error states of the list and the SLO page.

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

@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

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 477 passed • 1 skipped • 1184s

Status Count
✅ Passed 477
❌ Failed 0
⚠️ Flaky 11
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 44ab1ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

Not sure what this means? Click here to learn what changesets are.

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

@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.09%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

A grouped SLO expands into its tracked groups in the list, worst first,
each with its state, SLI, budget left and burn rate, and a note when more
groups have too few events to be tracked. A group with fewer than 100
eligible events in the window shows as "Too few events" and does not
alert. The SLO page shows all groups together or one group, picked from a
menu or a link (?group=, which group rows and alert notifications use);
its numbers, charts and bad events follow the group. With all groups, the
state is the worst group's. The definition panel names the group-by and
how many groups there are, and the recent firings count when any group was
firing.

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: 478 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: 11
  • Production lines changed: 478
  • Branch: alex/HDX-3001-slo-27-app-groups
  • 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.

pl={GROUP_INDENT}
data-testid="slo-groups-note"
>
{groups.length === 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2 — A grouped SLO with no events in its window says its groups show "after the first update"

A grouped SLO whose window has no events still gets groups: [] and groupCount: 0 once it updates (computeSloWindow in packages/api/src/controllers/sloStatusQueries.ts:118-119), so this note is wrong for it. Show the "after the first update" note only when status?.groups == null. When groups is an empty array, say there are no groups with events in the window yet.

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

{grouped &&
` · by ${slo.groupBy}` +
(groupCount != null
? `, ${groupCount} ${groupCount === 1 ? 'group' : 'groups'}`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2 — The group count in the list row is not formatted, unlike the definition panel

The list prints groupCount raw ("1234 groups"), but SloDefinitionPanel (SloDetailPanels.tsx:263) formats the same number with formatCount. Use formatCount(groupCount) here too, so both places show the same number the same way.

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

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

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

2 posted as inline comment(s) on the changed lines. 1 P3 folded at the bottom.

🔵 1 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/components/Slos/SloDetailPage.tsx:102 — New group logic has no tests: the header state choice, the select's value encoding and the untracked-groups count → This PR adds branching logic with no tests: which state the header shows (live vs stored, grouped vs single group vs ungrouped), the group: prefix round trip in SloGroupSelect (including an empty value and a group from a link that isn't tracked), and the untracked note in SloGroupRows. Move the header-state choice into a pure helper in sloUtils.ts, then unit-test it and the select's onChange mapping next to the existing __tests__/sloList.test.ts.

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. No P0/P1: the correctness and adversarial passes confirmed no crash, data-loss, injection, or correctness regression — empty-string group values, ?group= links to untracked groups, and never-updated/null status are all handled gracefully. The items below are recommended quality improvements.

🟡 P2 -- recommended

  • packages/app/src/components/Slos/SloDetailPage.tsx:153 -- In the all-groups view of a grouped SLO the header badge is pinned to the stored worst-group state, but SloNumbers/SloCharts render the live aggregate computed over all events, so badge, numbers, and charts on the same page can describe different states (e.g. one group breached, combined aggregate healthy).
    • Fix: In the grouped all-groups view either show the stored snapshot instead of live aggregate numbers, or label the numbers as a combined aggregate so they don't read as the SLO's headline state.
    • adversarial, correctness, kieran-typescript, julik-frontend-races
  • packages/app/src/components/Slos/sloUtils.ts:70 -- New grouped-SLO logic ships without unit tests despite an established repo pattern of unit-testing SLO helpers, and the untracked-count wording in SloTable, the state-resolution ternary in SloDetailPage, and the group: prefix decode in SloGroupSelect are embedded inline where they cannot be unit-tested.
    • Fix: Extract formatSloGroup, the untracked-count/pluralization, the detail-state resolution, and the group encode/decode into exported helpers and cover their branches (empty string, insufficient_data, untracked-from-link, 0/1/N groups).
    • testing, project-standards, correctness, adversarial
  • packages/app/src/components/Slos/SloEventsDrawer.tsx:90 -- The expression group != null ? status?.groups?.find(g => g.value === group) : status is duplicated in SloEventsDrawer, SloNumbers, and (as a variant) SloDetailPage, so the group-lookup contract lives in three places.
    • Fix: Extract one helper in sloUtils.ts (e.g. getSloScopedStatus(status, group)) and reuse it at all three sites.
    • maintainability
🔵 P3 nitpicks (6)
  • packages/app/src/components/Slos/SloTable.tsx:20 -- COLUMNS = 8 and the colSpan={3} in SloGroupRows are manually kept in sync with the header and data cells, so adding or removing a column silently breaks group-row alignment with no compile-time check.
    • Fix: Derive the column count from a shared column definition, or co-locate a comment tying COLUMNS, the header list, and the colSpan together.
  • packages/app/src/components/Slos/SloTable.tsx:84 -- The group query-param name is an untyped string contract: SloTable writes ?group= via URLSearchParams while SloDetailPage reads it via useQueryState('group'), and alert notifications link with it too.
    • Fix: Extract a shared SLO_GROUP_PARAM constant (or a link-builder helper) so a rename cannot silently break deep links.
  • packages/app/src/components/Slos/SloTable.tsx:805 -- The standalone note row uses style={CHILD_ROW_STYLE} for a background color where the code-style guide prefers Mantine style props.
    • Fix: Use the Mantine bg="var(--color-bg-muted)" prop on the note Table.Tr.
  • packages/app/src/components/Slos/SloNumbers.tsx:54 -- When the source is deleted and ?group= points at an untracked group, the component shows the "No numbers yet / updated in the background" info alert, implying the SLO has not computed yet rather than that this group is not tracked.
    • Fix: Distinguish "this group is not tracked" from "not computed yet" in the empty-state message.
  • packages/app/src/components/Slos/SloTable.tsx:796 -- The group note can read "The groups show after the first update." even when groupCount > 0 but status.groups is empty, which is mildly misleading.
    • Fix: Tie the "after the first update" wording to the absence of a computed status rather than to an empty groups array.
  • packages/app/src/components/Slos/useSloLiveStatus.ts:50 -- The live history/burn queries carry no placeholderData, so each group switch and each 5-minute now tick drops the numbers and charts to skeleton/stored before reloading (pre-existing for the tick, now also on per-group switching).
    • Fix: Add placeholderData: keepPreviousData to the slo-history/slo-burn query options if the flicker is undesirable.

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

Testing gaps:

  • No sloUtils.test.ts: formatSloGroup (including the empty-string (empty) branch) and the new insufficient_data label/description branches are uncovered.
  • No render/component tests for SloGroupSelect (prefix round-trip, untracked-from-link), SloTable's SloGroupRows (untracked-count boundaries: equal, >SLO_MAX_GROUPS, empty groups), or the SloDetailPage three-branch state resolution.
  • No test that the group scope threads into the query configs/keys (per-group caching) and into buildSloBadEventsSearch.
  • No end-to-end coverage of the ?group= round-trip (empty-string and untracked values) or the single-group insufficient_data path on the detail page.

Note: Prior PR comments were all automated (Vercel, e2e results, changeset, jscpd) with no human review feedback to verify; the jscpd clone it flagged is in packages/api/.../alerts.ts, outside this diff. Agent-native parity is maintained — clickstack_get_slo already returns status.groups and group-scoped deep links.

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-storybook — 44ab1ee0 Deployed Nov 24, 2026 by vercel[bot]
Preview – hyperdx-oss — 44ab1ee0 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