fix(telemetry): enable sourcemap resolution in Sentry#144
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 1779 uncovered lines. Files with missing lines (24)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 70.01% 69.98% -0.03%
==========================================
Files 51 51 —
Lines 5932 5926 -6
Branches 0 0 —
==========================================
+ Hits 4153 4147 -6
- Misses 1779 1779 —
- Partials 0 0 —Generated by Codecov Action |
Sourcemaps were being uploaded but stack traces still showed minified code. Root cause: The path normalization in beforeSend was modifying stack frame filenames (replacing /home/user with ~), which broke Sentry's ability to match frames against the uploaded sourcemaps via debug IDs. Changes: - Remove path normalization that broke sourcemap matching - Keep default SDK integrations (including Context) instead of disabling all - Remove redundant manual tags now that Context integration handles them
95e57fb to
2b8b144
Compare
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.
| // This is CLI-specific context not provided by the Context integration | ||
| const runtime = | ||
| typeof process.versions.bun !== "undefined" ? "bun" : "node"; | ||
| Sentry.setTag("runtime", runtime); |
There was a problem hiding this comment.
Telemetry tags removed, breaking searchability in Sentry
Low Severity
The platform, arch, runtime, and runtime.version tags were removed, with only cli.runtime remaining. The comment suggests the Context integration handles the rest, but the Context integration adds this data to the event's contexts object (not indexed), not as searchable tags. Any existing Sentry dashboards, alerts, or saved searches filtering by these tags would no longer work. Additionally, runtime was renamed to cli.runtime, which is a breaking change for existing queries.


Summary
Sourcemaps were being uploaded to Sentry but stack traces still showed minified code (e.g.,
t.with,br,bin.cjs:486:1136).Root cause: The
beforeSendpath normalization was modifying stack frame filenames (replacing/home/userwith~), which broke Sentry's ability to match frames against the uploaded sourcemaps via debug IDs.Changes
beforeSendthat broke sourcemap matching@sentry/esbuild-pluginwithsentry-clicommands for more reliable debug ID injectionBefore
After