fix(core): Send internal_error as span status for Vercel error spans#19921
fix(core): Send internal_error as span status for Vercel error spans#19921nicohrubec wants to merge 5 commits intodevelopfrom
internal_error as span status for Vercel error spans#19921Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Deps
Bug Fixes 🐛Core
Deps
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
size-limit report 📦
|
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
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.
| // Any such value should be normalized to a SpanStatusType value. We pick internal_error as it is the most generic. | ||
| if (span.status && span.status !== 'ok') { | ||
| span.status = 'internal_error'; | ||
| } |
There was a problem hiding this comment.
Overly broad status normalization overwrites valid span statuses
Low Severity
The condition span.status && span.status !== 'ok' overwrites all non-'ok' statuses to 'internal_error', including valid SpanStatusType values like 'cancelled', 'not_found', 'resource_exhausted', 'unknown_error', etc. that the upstream mapStatus function in the OpenTelemetry integration deliberately preserved. Only non-standard raw error message strings need normalization — valid status types carry useful diagnostic meaning (e.g., 'cancelled' indicates user cancellation, not an internal error) and would lose that information here.


Follow up to: #19863
Vercel sets raw error messages as span status. Currently we send them as is, but these values should be normalized to a known
SpanStatusType.I confirmed the behavior with https://github.com/getsentry/testing-ai-sdk-integrations.
Closes #19922 (added automatically)