File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import sentry_sdk
66from sentry_sdk .integrations import DidNotEnable
77from sentry_sdk .scope import should_send_default_pii
8- from sentry_sdk .traces import NoOpStreamedSpan
8+ from sentry_sdk .traces import NoOpStreamedSpan , StreamedSpan
99from sentry_sdk .tracing import SOURCE_FOR_STYLE , TransactionSource
1010from sentry_sdk .tracing_utils import has_span_streaming_enabled
1111from sentry_sdk .utils import transaction_from_function
@@ -95,7 +95,9 @@ def _sentry_call(*args: "Any", **kwargs: "Any") -> "Any":
9595 if has_span_streaming_enabled (client .options ):
9696 current_span = current_scope .streamed_span
9797
98- if not isinstance (current_span , NoOpStreamedSpan ):
98+ if isinstance (current_span , StreamedSpan ) and not isinstance (
99+ current_span , NoOpStreamedSpan
100+ ):
99101 segment = current_span ._segment
100102 segment ._update_active_thread ()
101103
Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ def _default(value: "Any") -> "Any":
254254def _set_request_body_data_on_streaming_segment (
255255 info : "Optional[Dict[str, Any]]" ,
256256) -> None :
257- current_span = sentry_sdk .get_current_span ()
257+ current_span = sentry_sdk .get_current_streamed_span ()
258258 if (
259259 info
260260 and "data" in info
You can’t perform that action at this time.
0 commit comments