Skip to content

feat(telemetry): add performance instrumentation and CLI Performance dashboard#625

Merged
BYK merged 4 commits intomainfrom
feat/performance-dashboard
Apr 1, 2026
Merged

feat(telemetry): add performance instrumentation and CLI Performance dashboard#625
BYK merged 4 commits intomainfrom
feat/performance-dashboard

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 1, 2026

Summary

  • Add tracing spans and timing attributes for key performance-sensitive operations
  • Remove redundant distribution metrics that duplicate span attributes
  • Create a CLI Performance dashboard with 18 widgets

Instrumentation Changes

Change File Details
Target resolution span resolve-target.ts Wraps resolveOrgAndProject() and resolveAllTargets() in resolve spans with resolve.method (flags/env_vars/defaults/dsn/inference/none) and resolve.cache_hit attributes
Env file scanning span dsn/env-file.ts Wraps detectFromEnvFiles() and detectFromAllEnvFiles() in dsn.detect.env spans with dsn.env_files_checked and dsn.env_dsn_found attributes
Command phase timing command.ts Adds phase.pre_ms, phase.exec_ms, phase.render_ms attributes to the root cli.command span via performance.now() markers
Completion result count telemetry.ts Emits completion.result_count distribution metric from the deferred telemetry queue
Remove redundant metrics dsn/code-scanner.ts Removes dsn.files_collected, dsn.files_scanned, dsn.dsns_found distribution metrics — span attributes on dsn.detect.code already capture identical data

Dashboard Layout (18 widgets, 10 rows)

Row Left (w=3) Right (w=3)
1 Command Duration (p50/p75/p90) Command Volume by Runtime
2 Duration by Command (full w=6)
3 Completion Latency (p50/p75/p90) Completion by Command (p75)
4 Target Resolution (p50/p75/p90) Resolution by Method
5 Command Phase Breakdown (full w=6)
6 DSN Detection Duration (p75) File Scan Volume (avg)
7 Project Root Detection HTTP Cache Hit/Miss
8 API Response Time (p50/p90) API Calls per Command
9 CPU & Event Loop Utilization Memory Usage
10 Seer AI Outcomes Delta Upgrade Stats

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Telemetry

  • Add performance instrumentation and CLI Performance dashboard by BYK in #625
  • Upgrade Sentry SDK to 10.47.0 and enable runtime metrics by BYK in #622

Other

  • (auth) Show token expiry in days/weeks instead of raw hours by BYK in #620
  • (ci) Add delta patch generation for stable releases by BYK in #618
  • (dashboard) Render text widget markdown content in dashboard view by BYK in #624
  • (traces) Expose custom span attributes and improve agent guidance by BYK in #623

Bug Fixes 🐛

  • (build) Use esbuild for binary bundling to fix minifier collision bug by BYK in #619
  • (init) Prompt for team selection when user belongs to multiple teams by betegon in #621
  • (telemetry) Derive environment from CLI_VERSION instead of NODE_ENV by BYK in #627
  • (upgrade) Remove "What's new" header from changelog output by BYK in #626

Internal Changes 🔧

  • Regenerate skill files and command docs by github-actions[bot] in e01b2520

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Codecov Results 📊

129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 97.78%. Project has 1342 uncovered lines.
❌ Project coverage is 95.54%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/lib/telemetry.ts 0.00% ⚠️ 5 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    95.56%    95.54%    -0.02%
==========================================
  Files          204       204         —
  Lines        30061     30109       +48
  Branches         0         0         —
==========================================
+ Hits         28728     28767       +39
- Misses        1333      1342        +9
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK marked this pull request as ready for review April 1, 2026 20:10
BYK added 2 commits April 1, 2026 21:34
…dashboard

Add tracing spans and timing attributes for key performance-sensitive
operations, remove redundant metrics, and create a Sentry dashboard
with 18 widgets covering CLI responsiveness, completion UX, target
resolution, DSN detection, cache health, API latency, runtime resources,
Seer AI, and upgrade metrics.

Instrumentation changes:
- Wrap resolveOrgAndProject/resolveAllTargets in 'resolve' spans with
  resolve.method and resolve.cache_hit attributes
- Wrap detectFromEnvFiles/detectFromAllEnvFiles in 'dsn.detect.env' spans
  with dsn.env_files_checked and dsn.env_dsn_found attributes
- Add phase.pre_ms, phase.exec_ms, phase.render_ms timing attributes to
  the cli.command root span via setPhaseTimingAttributes helper
- Emit completion.result_count distribution metric from deferred queue
- Remove redundant dsn.files_collected/dsn.files_scanned/dsn.dsns_found
  distribution metrics (span attributes already capture identical data)

Dashboard: https://sentry.sentry.io/dashboard/2335804/
…al measurement

Replace performance.now() markers and setPhaseTimingAttributes with
cli.command.exec and cli.command.render child spans. Span durations
are the idiomatic way to measure phases — they appear in the trace
waterfall and don't require custom attributes.

Updated the 'Command Phase Breakdown' dashboard widget to query
span.duration grouped by span.op instead of custom phase.* attributes.
@BYK BYK force-pushed the feat/performance-dashboard branch from ebb31ba to 113be08 Compare April 1, 2026 21:34
- Remove resolve.cache_hit attribute — detectedFrom never contains
  'cached', making the check always false. Cache observability is
  already covered by the Sentry Cache Module spans on response-cache.
- Fix dsn.env_files_checked in detectFromAllEnvFiles to use
  ENV_FILES.length (file names checked) instead of allMtimes.length
  (files where DSNs were found), matching detectFromEnvFiles behavior.
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

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 and found 1 potential issue.

Fix All in Cursor

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

… packages

Track packagesScanned in detectFromMonorepoEnvFiles and compute
total as ENV_FILES.length * (1 + packagesScanned) — each package
directory checks the same set of env file names as the root.
@BYK BYK merged commit 06d4ff4 into main Apr 1, 2026
26 checks passed
@BYK BYK deleted the feat/performance-dashboard branch April 1, 2026 22:28
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.

1 participant