sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

[do not merge] Span first

Open sentrivana opened this issue 1 month ago • 1 comments

Description

WIP: Draft implementation of span first/span streaming in the Python SDK. Uses the existing start_span API, but batches spans and sends them independently of the transaction/segment span.

Enables to run the SDK in two modes: static and streaming. Static mode is the current status quo where spans are sent together with their transaction (segment) as the transaction finishes. Streaming mode makes two major changes to the behavior of the start_span API:

  • Spans are added to the streaming buffer on finish and they may be sent in an envelope without their segment.
  • [Later] start_span without a running segment will be promoted to a segment span. (For the POC, this is not the case; we just use the existing start_transaction.)

TODOs:

  • ignore_spans
  • start_span should start a segment span if there is no active segment span

Issues

  • Project: https://linear.app/getsentry/project/span-first-sdk-python-727da28dd037/overview

Reminders

sentrivana avatar Nov 19 '25 15:11 sentrivana