Skip to content

ref: Support outgoing trace propagation in span first (18) #11899

ref: Support outgoing trace propagation in span first (18)

ref: Support outgoing trace propagation in span first (18) #11899

Triggered via pull request March 11, 2026 13:54
Status Cancelled
Total duration 3m 43s
Artifacts

test-integrations-common.yml

on: pull_request
Matrix: Common
All Common tests passed
4s
All Common tests passed
Fit to window
Zoom out
Zoom in

Annotations

27 errors
Common (3.6, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.6, ubuntu-22.04)
The operation was canceled.
Common (3.7, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.7, ubuntu-22.04)
The operation was canceled.
Common (3.13, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.13, ubuntu-22.04)
The operation was canceled.
Common (3.11, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.11, ubuntu-22.04)
The operation was canceled.
Common (3.14t, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.14t, ubuntu-22.04)
The operation was canceled.
Common (3.8, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.8, ubuntu-22.04)
The operation was canceled.
Common (3.10, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.10, ubuntu-22.04)
The operation was canceled.
Common (3.9, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.9, ubuntu-22.04)
The operation was canceled.
Common (3.12, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.12, ubuntu-22.04)
The operation was canceled.
Common (3.14, ubuntu-22.04)
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
Common (3.14, ubuntu-22.04)
The operation was canceled.
All Common tests passed
Process completed with exit code 1.
Test Common
Canceling since a higher priority waiting request for Test Common-ivana/span-first-18-trace-propagation exists
NoOpStreamedSpan._iter_headers() raises AttributeError due to missing _segment attribute: sentry_sdk/scope.py#L688
The change at line 688 calls `span._iter_headers()` without guarding against `NoOpStreamedSpan`. Unlike other similar methods (`get_traceparent()`, `get_baggage()`, `get_trace_context()`) which all have `not isinstance(self.span, NoOpStreamedSpan)` guards, this method lacks the check. When `span` is a `NoOpStreamedSpan`, calling `_iter_headers()` invokes the inherited `StreamedSpan._iter_headers()` which accesses `self._segment` - an attribute that `NoOpStreamedSpan` never initializes, causing an `AttributeError`.
[DP5-QF6] NoOpStreamedSpan._iter_headers() raises AttributeError due to missing _segment attribute (additional location): sentry_sdk/traces.py#L504
The change at line 688 calls `span._iter_headers()` without guarding against `NoOpStreamedSpan`. Unlike other similar methods (`get_traceparent()`, `get_baggage()`, `get_trace_context()`) which all have `not isinstance(self.span, NoOpStreamedSpan)` guards, this method lacks the check. When `span` is a `NoOpStreamedSpan`, calling `_iter_headers()` invokes the inherited `StreamedSpan._iter_headers()` which accesses `self._segment` - an attribute that `NoOpStreamedSpan` never initializes, causing an `AttributeError`.
NameError: 'Span' is not defined at runtime in set_span_errored: sentry_sdk/tracing_utils.py#L1111
The `set_span_errored` function uses `isinstance(span, Span)` at line 1111, but `Span` is only imported inside the `TYPE_CHECKING` block (line 1615), making it unavailable at runtime. When this function is called with a span that is actually a `Span` instance, it will raise `NameError: name 'Span' is not defined`.
NoOpStreamedSpan will raise AttributeError when inherited methods access _segment: sentry_sdk/traces.py#L504
The new methods `_dynamic_sampling_context()`, `_to_baggage()`, `_iter_headers()`, and `_get_trace_context()` access `self._segment`, but `NoOpStreamedSpan` inherits these methods without initializing the `_segment` attribute. When `_iter_headers()` is called on a `NoOpStreamedSpan` (e.g., via `scope.iter_trace_propagation_headers()`), accessing `self._segment` will raise `AttributeError` because the slot is inherited but never assigned. The guard `if not self._segment:` cannot work since it tries to access an uninitialized slot attribute.
Span class not imported at runtime causes NameError: sentry_sdk/tracing_utils.py#L1111
The `Span` class is only imported inside `TYPE_CHECKING` (line 1615), making it unavailable at runtime. However, line 1111 uses `isinstance(span, Span)` which requires the class to exist at runtime. When `set_span_errored()` is called, this will raise a `NameError: name 'Span' is not defined`.