Skip to content

Catch any raised exceptions from the serialization json.dumps call an…

48415ad
Select commit
Loading
Failed to load commit list.
Merged

feat(starlette): Support span streaming #6123

Catch any raised exceptions from the serialization json.dumps call an…
48415ad
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: find-bugs completed Apr 27, 2026 in 38s

1 issue

find-bugs: Found 1 issue (1 medium)

Medium

Streaming middleware span uses 'middleware.name' attribute instead of 'starlette.middleware_name' - `sentry_sdk/integrations/starlette.py:178`

In the streaming branch of _start_middleware_span, the attribute key is set to middleware.name, while the legacy (non-streaming) branch sets a starlette.middleware_name tag. The PR description explicitly states that the streaming path should send starlette.middleware_name as an attribute. This inconsistency means downstream consumers/queries that filter on starlette.middleware_name will not match streamed spans, breaking parity between the streaming and legacy paths.


Duration: 37.5s · Tokens: 133.3k in / 1.4k out · Cost: $1.15

Annotations

Check warning on line 178 in sentry_sdk/integrations/starlette.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: find-bugs

Streaming middleware span uses 'middleware.name' attribute instead of 'starlette.middleware_name'

In the streaming branch of `_start_middleware_span`, the attribute key is set to `middleware.name`, while the legacy (non-streaming) branch sets a `starlette.middleware_name` tag. The PR description explicitly states that the streaming path should send `starlette.middleware_name` as an attribute. This inconsistency means downstream consumers/queries that filter on `starlette.middleware_name` will not match streamed spans, breaking parity between the streaming and legacy paths.