feat(wsgi): Migrate to span first #5988
1 issue
find-bugs: Found 1 issue (1 high)
High
Span class lacks set_attribute method used in non-streaming mode - `sentry_sdk/integrations/wsgi.py:167`
When span_streaming is False (line 146), the code uses sentry_sdk.start_transaction() which returns a Transaction (extends Span). On line 167, span.set_attribute() is called, but the Span/Transaction classes only have set_data() and set_tag() methods, not set_attribute(). This method only exists on StreamedSpan. The call will raise AttributeError, causing request attributes to never be set on non-streaming spans.
Duration: 3m 51s · Tokens: 2.1M in / 17.6k out · Cost: $3.37 (+extraction: $0.00, +merge: $0.00)
Annotations
Check failure on line 167 in sentry_sdk/integrations/wsgi.py
sentry-warden / warden: find-bugs
Span class lacks set_attribute method used in non-streaming mode
When `span_streaming` is False (line 146), the code uses `sentry_sdk.start_transaction()` which returns a `Transaction` (extends `Span`). On line 167, `span.set_attribute()` is called, but the `Span`/`Transaction` classes only have `set_data()` and `set_tag()` methods, not `set_attribute()`. This method only exists on `StreamedSpan`. The call will raise `AttributeError`, causing request attributes to never be set on non-streaming spans.