File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1182,15 +1182,6 @@ 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 (sentry_sdk .get_client ().options ):
1186- warnings .warn (
1187- "Using span streaming API in non-span-streaming mode. Use "
1188- "sentry_sdk.start_transaction() and sentry_sdk.start_span() "
1189- "instead." ,
1190- stacklevel = 2 ,
1191- )
1192- return NoOpStreamedSpan ()
1193-
11941185 if isinstance (parent_span , NoOpStreamedSpan ):
11951186 # parent_span is only set if the user explicitly set it
11961187 logger .debug (
Original file line number Diff line number Diff line change @@ -140,6 +140,17 @@ def start_span(
140140 :return: The span that has been started.
141141 :rtype: StreamedSpan
142142 """
143+ from sentry_sdk .tracing_utils import has_span_streaming_enabled
144+
145+ if not has_span_streaming_enabled (sentry_sdk .get_client ().options ):
146+ warnings .warn (
147+ "Using span streaming API in non-span-streaming mode. Use "
148+ "sentry_sdk.start_transaction() and sentry_sdk.start_span() "
149+ "instead." ,
150+ stacklevel = 2 ,
151+ )
152+ return NoOpStreamedSpan ()
153+
143154 return sentry_sdk .get_current_scope ().start_streamed_span (
144155 name , attributes , parent_span , active
145156 )
You can’t perform that action at this time.
0 commit comments