-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Note
The pull request "feat(core): Span serialization utilities (spanToV2JSON)" was created by @Lms24 but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
Summary
This PR adds span serialization utilities for converting spans to the V2 format, as part of the span streaming feature work.
Changes:
- Add
spanToV2JSONfunction to convert spans toSerializedSpan(V2 format) - Add
getV2SpanLinksfunction to convert span links with serialized attributes - Add
getV2StatusMessagefunction to convert status to'ok' | 'error' - Rename
getRootSpanimplementation toINTERNAL_getSegmentSpan(withgetRootSpankept as an alias) - Export all new utilities from
@sentry/core
Design notes:
spanToV2JSONchecks for agetSpanV2JSONmethod first (which will be added to SentrySpan in a later PR), then falls back to computing the V2 JSON from the span data- This ensures the function works with both SentrySpan and OpenTelemetry SDK spans
- The
INTERNAL_getSegmentSpanrename prepares for future changes where "segment span" terminology is used instead of "root span"
Dependencies: PR 1 (SpanV2JSON Types) - already merged
Test plan
-
yarn lintpasses -
yarn testpasses for@sentry/core -
yarn build:devbuilds successfully
Made with Cursor
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels