Skip to content

merge master

bc1f32d
Select commit
Loading
Failed to load commit list.
Merged

feat(stdlib): Support span streaming #6154

merge master
bc1f32d
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Apr 29, 2026 in 1m 29s

2 issues

Low

ApproxDict({}) assertion is a no-op and weakens init span coverage - `tests/integrations/stdlib/test_subprocess.py:165`

On line 165, subprocess_init_span.get("attributes", {}) == data compares against data = ApproxDict({}). Per ApproxDict's __eq__ (tests/conftest.py), an empty ApproxDict matches any dict because the all(...) over zero items is trivially True. As a result, this assertion validates nothing about the init span's attributes and silently passes regardless of what attributes are present (or absent). The test loses coverage of the init span's expected attribute payload in the streaming path.

Streaming branch picks first span instead of last, may select wrong span for header assertion - `tests/integrations/stdlib/test_httplib.py:271`

In the streaming branch, request_span = next(item.payload for item in items if item.type == "span") returns the FIRST span emitted, while the non-streaming branch explicitly uses event["spans"][-1] (the LAST span, typically the HTTP request child span). If both the parent span and the HTTP child span are emitted as items, the streaming path may capture the parent span's id instead of the HTTP request span's id, causing expected_sentry_trace's parent_span_id to mismatch the value actually used in the outgoing sentry-trace header.

Also found at:

  • tests/integrations/stdlib/test_httplib.py:360
4 skills analyzed
Skill Findings Duration Cost
code-review 1 44.7s $2.44
find-bugs 1 1m 16s $2.26
skill-scanner 0 1m 27s $1.38
security-review 0 1m 13s $1.55

Duration: 4m 42s · Tokens: 1.2M in / 7.8k out · Cost: $7.63 (+merge: $0.00)