Skip to content

feat: Support span first in Graphene

d7f7934
Select commit
Loading
Failed to load commit list.
Draft

feat: Support span first in Graphene #5708

feat: Support span first in Graphene
d7f7934
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Mar 19, 2026 in 1m 35s

1 issue

code-review: Found 1 issue (1 medium)

Medium

StreamedSpan exceptions not marked as errors due to bypassing __exit__ - `sentry_sdk/integrations/graphene.py:168-174`

When has_span_streaming_enabled is True, the span is created but never entered as a context manager (no __enter__ call), and ended directly via .end() instead of __exit__. This skips the exception handling logic in StreamedSpan.__exit__ that sets status = SpanStatus.ERROR when an exception occurs. If a GraphQL operation throws an exception, the streaming span will be marked as 'ok' instead of 'error', losing important error information.


Duration: 1m 33s · Tokens: 209.6k in / 4.1k out · Cost: $0.54 (+extraction: $0.00, +fix_gate: $0.00)

Annotations

Check warning on line 174 in sentry_sdk/integrations/graphene.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

StreamedSpan exceptions not marked as errors due to bypassing __exit__

When `has_span_streaming_enabled` is True, the span is created but never entered as a context manager (no `__enter__` call), and ended directly via `.end()` instead of `__exit__`. This skips the exception handling logic in `StreamedSpan.__exit__` that sets `status = SpanStatus.ERROR` when an exception occurs. If a GraphQL operation throws an exception, the streaming span will be marked as 'ok' instead of 'error', losing important error information.