Currently, only a handful of integrations create transactions. Most integrations just create spans via sentry_sdk.start_span. In that case, the spans only get created if there's a running transaction.
In span streaming, sentry_sdk.traces.start_span will always create a span. If there is no active span, it'll be a segment (root-level) span. This is not what we want in most integrations. We want to keep the old behavior to only create the spans if they'd be child spans.
For all integrations that have tracing:
- If the legacy tracing code path creates a span via
start_span, guard the streaming traces.start_span counterpart with a if sentry_sdk.traces.get_current_span() is not None check to only create the span if there's a running span.
Currently, only a handful of integrations create transactions. Most integrations just create spans via
sentry_sdk.start_span. In that case, the spans only get created if there's a running transaction.In span streaming,
sentry_sdk.traces.start_spanwill always create a span. If there is no active span, it'll be a segment (root-level) span. This is not what we want in most integrations. We want to keep the old behavior to only create the spans if they'd be child spans.For all integrations that have tracing:
start_span, guard the streamingtraces.start_spancounterpart with aif sentry_sdk.traces.get_current_span() is not Nonecheck to only create the span if there's a running span.