feat(httpx): Migrate to span first #6084
Merged
@sentry/warden / warden: find-bugs
completed
Apr 17, 2026 in 7m 24s
1 issue
find-bugs: Found 1 issue (1 low)
Low
URL attributes lost on StreamedSpan when HTTP request raises exception - `sentry_sdk/integrations/httpx.py:75-103`
In the span streaming path, URL-related attributes (url.full, url.query, url.fragment) are collected in a local attributes dict but only set on the span via set_attributes() at line 103, after real_send() completes. If real_send() raises an exception, these attributes are never set on the span. In contrast, the legacy path sets these attributes (lines 119-123) before calling real_send() (line 141), ensuring URL context is preserved even on failed requests.
Duration: 7m 23s · Tokens: 3.1M in / 25.7k out · Cost: $6.73 (+extraction: $0.00)
Loading