Skip to content

Overview: KPI compare, sparklines, and latency (#183)#272

Merged
unjica merged 7 commits into
developfrom
feature/overview-kpi-compare-183
Jul 7, 2026
Merged

Overview: KPI compare, sparklines, and latency (#183)#272
unjica merged 7 commits into
developfrom
feature/overview-kpi-compare-183

Conversation

@unjica

@unjica unjica commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds overview KPI cards for errors, events, and sessions with prior-period compare and sparklines, plus optional avg response time and Apdex when Node $request duration data exists
  • Extends GET /api/overview with kpiSparklines, requestMetrics, and recentSessions
  • Polishes the hero telemetry volume chart and introduces a top-errors / recent-sessions grid aligned with the overview mockup

Closes #183

Test plan

  • pnpm lint && pnpm test && pnpm build
  • Open /dashboard/overview with a project that has errors, events, and sessions — verify KPI sparklines and compare toggle
  • Ingest Node $request events with duration_ms — verify avg response and Apdex KPIs appear
  • Confirm top-errors / recent-sessions grid matches the selected metrics window
  • Confirm hero volume chart shows events area + errors/sessions lines

Made with Cursor

Align the overview page with the v1.5.0 dashboard mockup by exposing compare sparklines, optional Node $request latency/Apdex, and a top-errors / recent-sessions grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/overview-timeseries.ts Outdated
Apply started_at and event created_at upper bounds so sessions outside the metrics window no longer appear in sparklines and volume charts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/routes/api.ts
Add metricsTopErrorGroups so the grid matches recent sessions when the time picker is unselected, while paginated error lists keep the list window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/overview-kpi.ts
Comment thread apps/api/src/lib/overview-timeseries.ts
Rank top errors by in-window occurrence counts and bound environment-filtered session totals to the same started_at and event window as sparklines.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/overview-kpi.ts
Comment thread apps/api/src/lib/overview-kpi.ts
Bound environment-filtered session EXISTS to the metrics window and omit Apdex sparkline points when buckets have no request samples.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread apps/api/src/lib/sessions-list-query.ts
Apply per-window environment/release EXISTS in summary scalars and sparklines so headline counts match filtered list totals.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8970071. Configure here.

Comment thread apps/api/src/lib/overview-kpi.ts Outdated
Comment thread apps/api/src/lib/overview-kpi.ts
Skip compare deltas when the prior window has no timed $request rows and use null avg-response sparkline buckets instead of zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
@unjica unjica merged commit b600ad1 into develop Jul 7, 2026
4 checks passed
@unjica unjica deleted the feature/overview-kpi-compare-183 branch July 7, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overview: KPI compare, sparklines, and latency when available

1 participant