Skip to content

Span Streaming Implementation #17836

@Lms24

Description

@Lms24

This issue tracks steps for getting #17852 step by step into a reviewed and cleaned up state.

Tier 1: Foundation

  • PR 1: Span and envelope type definitions (feat(core/spans): Add span v2 and envelope type definitions #19100)
  • PR 3: Semantic Attributes for Span Streaming - Add semantic attributes for common, user, web vitals, browser, and HTTP contexts
  • PR 4: beforeSetup Integration Hook - Add beforeSetup hook to Integration interface and beforeSetupIntegrations function

Tier 2: Core Infrastructure

  • PR 2: traceLifecycle Option and beforeSendSpan Type Updates - Add traceLifecycle option, withStreamSpan, and isV2BeforeSendSpanCallback utilities
  • PR 5: Client Hooks for Span Processing - Add afterSpanEnd, afterSegmentSpanEnd, processSpan, processSegmentSpan, and enqueueSpan hooks
  • PR 6: hasSpanStreamingEnabled Utility - New utility function to check if span streaming is enabled
  • PR 7: Span Serialization Utilities (spanToV2JSON) - Add spanToV2JSON, getV2SpanLinks, getV2StatusMessage functions

Tier 3: Pipeline Components

  • PR 8: SentrySpan.getSpanV2JSON Method - Add getSpanV2JSON() method and emit hooks after span end
  • PR 9: SpanBuffer Class - New class for buffering spans before sending
  • PR 10: createSpanV2Envelope Function - Add envelope creation function for span V2
  • PR 11: spanFirstUtils (Context to Attributes Conversion) - Add safeSetSpanJSONAttributes, applyBeforeSendSpanCallback, contextsToAttributes utilities
  • PR 13: shouldIgnoreSpan and reparentChildSpans Updates - Update to support both SpanJSON and SpanV2JSON

Tier 4: Core Feature

  • PR 12: captureSpan Pipeline - New captureSpan function and merge attributes in mergeScopeData

Tier 5: Integrations

  • PR 14: Core spanStreamingIntegration (Server) - New server-side span streaming integration
  • PR 15: requestDataIntegration Span Streaming Support - Add processSegmentSpan hook handler
  • PR 16: nodeContextIntegration Updates - Set contexts on global scope, update span scope on spanEnd
  • PR 17: OpenTelemetry StreamingSpanExporter - New streaming exporter for OpenTelemetry integration
  • PR 18: Browser spanStreamingIntegration - Browser-specific span streaming integration
  • PR 19: Browser httpContextIntegration Updates - Add processSegmentSpan hook for span streaming

Tier 6: Browser Metrics

  • PR 20: Browser Web Vitals as Attributes (CLS, LCP) - Use startInactiveSpan with attributes for CLS/LCP
  • PR 21: Browser Web Vitals INP and TTFB Updates - Send INP as V2 span when streaming, set web vitals as attributes
  • PR 22: browserTracingIntegration Updates - Deprecate standalone span options, use hasSpanStreamingEnabled

Tier 7: Exports and Tests

  • PR 23: SDK Re-exports (withStreamSpan) - Export withStreamSpan from browser, node, and node-core packages
  • PR 24: Test Utilities for Span V2 - Add waitForSpanV2Envelope, waitForSpanV2, waitForSpansV2 utilities
  • PR 25: Browser Integration Test Utilities - New utilities for browser integration tests
  • PR 26: Node Integration Tests for Span Streaming - Integration tests for default span streaming and ignoreSpans
  • PR 27: Browser Integration Tests for Span Streaming - Tests for pageload, error, linked-traces, measurements, web-vitals, backgroundtab-pageload

Tier 8: Final

  • PR 28: Size Limit and Cleanup - Update size limits and add changelog entries

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions