Skip to content

.

a656540
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

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

.
a656540
Select commit
Loading
Failed to load commit list.
GitHub Actions / warden: find-bugs completed Mar 11, 2026 in 7m 37s

2 issues

find-bugs: Found 2 issues (1 high, 1 medium)

High

NoOpStreamedSpan.iter_headers() will raise AttributeError due to missing _segment attribute - `sentry_sdk/scope.py:688`

The change from span.iter_headers() to span._iter_headers() can cause an AttributeError when span is a NoOpStreamedSpan. The _iter_headers method in StreamedSpan accesses self._segment (line 505), but NoOpStreamedSpan doesn't initialize this attribute since it doesn't call super().__init__(). Other methods in this file (get_traceparent, get_baggage, get_trace_context) have guards like not isinstance(self.span, NoOpStreamedSpan) but this method is missing that check.

Also found at:

  • sentry_sdk/tracing_utils.py:1117-1118

Medium

set_transaction_name returns early for NoOpStreamedSpan, skipping _transaction_info update - `sentry_sdk/scope.py:842-843`

When self._span is a NoOpStreamedSpan, the code returns early on line 843 before reaching line 857-858 which updates self._transaction_info["source"]. In the original code, this update always occurred when a source was provided. This causes inconsistent state where _transaction is set but _transaction_info["source"] is not updated.


Duration: 7m 31s · Tokens: 7.2M in / 55.0k out · Cost: $9.83 (+extraction: $0.02, +merge: $0.00, +fix_gate: $0.01)

Annotations

Check failure on line 688 in sentry_sdk/scope.py

See this annotation in the file changed.

@github-actions github-actions / warden: find-bugs

NoOpStreamedSpan.iter_headers() will raise AttributeError due to missing _segment attribute

The change from `span.iter_headers()` to `span._iter_headers()` can cause an `AttributeError` when `span` is a `NoOpStreamedSpan`. The `_iter_headers` method in `StreamedSpan` accesses `self._segment` (line 505), but `NoOpStreamedSpan` doesn't initialize this attribute since it doesn't call `super().__init__()`. Other methods in this file (get_traceparent, get_baggage, get_trace_context) have guards like `not isinstance(self.span, NoOpStreamedSpan)` but this method is missing that check.

Check failure on line 1118 in sentry_sdk/tracing_utils.py

See this annotation in the file changed.

@github-actions github-actions / warden: find-bugs

[QEV-CXW] NoOpStreamedSpan.iter_headers() will raise AttributeError due to missing _segment attribute (additional location)

The change from `span.iter_headers()` to `span._iter_headers()` can cause an `AttributeError` when `span` is a `NoOpStreamedSpan`. The `_iter_headers` method in `StreamedSpan` accesses `self._segment` (line 505), but `NoOpStreamedSpan` doesn't initialize this attribute since it doesn't call `super().__init__()`. Other methods in this file (get_traceparent, get_baggage, get_trace_context) have guards like `not isinstance(self.span, NoOpStreamedSpan)` but this method is missing that check.

Check warning on line 843 in sentry_sdk/scope.py

See this annotation in the file changed.

@github-actions github-actions / warden: find-bugs

set_transaction_name returns early for NoOpStreamedSpan, skipping _transaction_info update

When `self._span` is a `NoOpStreamedSpan`, the code returns early on line 843 before reaching line 857-858 which updates `self._transaction_info["source"]`. In the original code, this update always occurred when a source was provided. This causes inconsistent state where `_transaction` is set but `_transaction_info["source"]` is not updated.