feat(telemetry): add performance instrumentation and CLI Performance dashboard#625
Merged
feat(telemetry): add performance instrumentation and CLI Performance dashboard#625
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Telemetry
Other
Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 97.78%. Project has 1342 uncovered lines. Files with missing lines (1)
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 |
…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.
ebb31ba to
113be08
Compare
- 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.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Instrumentation Changes
resolve-target.tsresolveOrgAndProject()andresolveAllTargets()inresolvespans withresolve.method(flags/env_vars/defaults/dsn/inference/none) andresolve.cache_hitattributesdsn/env-file.tsdetectFromEnvFiles()anddetectFromAllEnvFiles()indsn.detect.envspans withdsn.env_files_checkedanddsn.env_dsn_foundattributescommand.tsphase.pre_ms,phase.exec_ms,phase.render_msattributes to the rootcli.commandspan viaperformance.now()markerstelemetry.tscompletion.result_countdistribution metric from the deferred telemetry queuedsn/code-scanner.tsdsn.files_collected,dsn.files_scanned,dsn.dsns_founddistribution metrics — span attributes ondsn.detect.codealready capture identical dataDashboard Layout (18 widgets, 10 rows)