11"""
2- EXPERIMENTAL. Do not use in production.
2+ The API in this file is only meant to be used in span streaming mode. It should
3+ not be mixed with the legacy tracing API (sentry_sdk.start_transaction,
4+ sentry_sdk.start_span, etc.).
35
4- The API in this file is only meant to be used in span streaming mode.
6+ You can enable span streaming mode via:
57
6- You can enable span streaming mode via
7- sentry_sdk.init(trace_lifecycle="stream").
8+ ```
9+ import sentry_sdk
10+
11+ sentry_sdk.init(
12+ trace_lifecycle="stream",
13+ )
14+ ```
15+
16+ See
17+ https://docs.sentry.io/platforms/python/tracing/streamed-spans/migration-guide/
18+ for how to migrate to span streaming.
819"""
920
1021import sys
@@ -109,10 +120,7 @@ def start_span(
109120 active : bool = True ,
110121) -> "StreamedSpan" :
111122 """
112- Start a span.
113-
114- EXPERIMENTAL. Use sentry_sdk.start_transaction() and sentry_sdk.start_span()
115- instead.
123+ Start a span in streaming mode.
116124
117125 The span's parent, unless provided explicitly via the `parent_span` argument,
118126 will be the current active span, if any. If there is none, this span will
@@ -183,9 +191,7 @@ def start_span(
183191
184192def continue_trace (incoming : "dict[str, Any]" ) -> None :
185193 """
186- Continue a trace from headers or environment variables.
187-
188- EXPERIMENTAL. Use sentry_sdk.continue_trace() instead.
194+ Continue a trace from headers or environment variables in streaming mode.
189195
190196 This function sets the propagation context on the scope. Any span started
191197 in the updated scope will belong under the trace extracted from the
@@ -209,9 +215,7 @@ def continue_trace(incoming: "dict[str, Any]") -> None:
209215
210216def new_trace () -> None :
211217 """
212- Resets the propagation context, forcing a new trace.
213-
214- EXPERIMENTAL.
218+ Resets the propagation context, forcing a new trace, in streaming mode.
215219
216220 This function sets the propagation context on the scope. Any span started
217221 in the updated scope will start its own trace.
@@ -805,9 +809,7 @@ def trace(
805809 active : bool = True ,
806810) -> "Union[Callable[P, R], Callable[[Callable[P, R]], Callable[P, R]]]" :
807811 """
808- Decorator to start a span around a function call.
809-
810- EXPERIMENTAL. Use @sentry_sdk.trace instead.
812+ Decorator to start a span around a function call in streaming mode.
811813
812814 This decorator automatically creates a new span when the decorated function
813815 is called, and finishes the span when the function returns or raises an exception.
0 commit comments