Skip to content

Commit 597152d

Browse files
cursoragentclaude
andcommitted
Fix span streaming guard behavior
- return early in streaming trace decorators when streaming mode is disabled - resolve streaming option checks through Scope.get_client() Co-Authored-By: gpt-5.3-codex-high <noreply@anthropic.com>
1 parent 72f0968 commit 597152d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

sentry_sdk/scope.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ def start_streamed_span(
11821182
active: bool,
11831183
) -> "StreamedSpan":
11841184
# TODO: rename to start_span once we drop the old API
1185-
if not has_span_streaming_enabled(self.client.options):
1185+
if not has_span_streaming_enabled(self.get_client().options):
11861186
warnings.warn(
11871187
"Using span streaming API in non-span-streaming mode. Use "
11881188
"sentry_sdk.start_transaction() and sentry_sdk.start_span() "

sentry_sdk/tracing_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,7 @@ async def async_wrapper(*args: "Any", **kwargs: "Any") -> "Any":
966966
"@sentry_sdk.trace instead.",
967967
stacklevel=2,
968968
)
969+
return await f(*args, **kwargs)
969970

970971
span_name = name or qualname_from_function(f) or ""
971972

@@ -989,6 +990,7 @@ def sync_wrapper(*args: "Any", **kwargs: "Any") -> "Any":
989990
"@sentry_sdk.trace instead.",
990991
stacklevel=2,
991992
)
993+
return f(*args, **kwargs)
992994

993995
span_name = name or qualname_from_function(f) or ""
994996

0 commit comments

Comments
 (0)