-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(core): Add span serialization utilities (spanToV2JSON) #19140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: lms/feat-span-first
Are you sure you want to change the base?
Conversation
This PR adds utilities for serializing spans to the new V2 format: - `spanToV2JSON`: Converts a span to SerializedSpan (V2 format) - `getV2SpanLinks`: Converts span links with serialized attributes - `getV2StatusMessage`: Converts status to 'ok' | 'error' - `INTERNAL_getSegmentSpan`: Renamed from getRootSpan (with alias kept) These utilities are needed for the span streaming feature and will be used by subsequent PRs to serialize spans before sending. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Results 📊Generated by Codecov Action |
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.
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.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| }); | ||
| }); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing integration or E2E test for feature PR
Low Severity
Per the review rules file, feat PRs should include at least one integration or E2E test. This PR only includes unit tests for the new spanToStreamedSpanJSON and spanJsonToSerializedSpan utilities. While the PR discussion mentions this is part of building blocks for a larger feature, consider adding integration tests to verify the serialization pipeline works end-to-end when the feature is complete.


This PR adds span JSON conversion and serialization helpers for span streaming:
spanToStreamedSpanJSON: Converts aSpaninstance to a JSON object used as intermediate representation as outlined in feat(core/spans): Add span v2 and envelope type definitions #19100SentrySpan::getStreamedSpanJSONmethod to convert our own spansspanToJSONworks today.spanJsonToSerializedSpan: Converts aStreamedSpanJSONinto the finalSerializedSpanto be sent to Sentry.This PR also adds unit tests for both helpers.
ref #17836