|
6 | 6 | from sentry_sdk._init_implementation import init |
7 | 7 | from sentry_sdk.consts import INSTRUMENTER |
8 | 8 | from sentry_sdk.scope import Scope, _ScopeManager, new_scope, isolation_scope |
9 | | -from sentry_sdk.traces import StreamedSpan |
| 9 | +from sentry_sdk.traces import StreamedSpan, _get_current_streamed_span |
10 | 10 | from sentry_sdk.tracing import NoOpSpan, Transaction, trace |
11 | 11 | from sentry_sdk.crons import monitor |
12 | 12 |
|
@@ -67,7 +67,6 @@ def overload(x: "T") -> "T": |
67 | 67 | "get_isolation_scope", |
68 | 68 | "get_current_scope", |
69 | 69 | "get_current_span", |
70 | | - "get_current_streamed_span", |
71 | 70 | "get_traceparent", |
72 | 71 | "is_initialized", |
73 | 72 | "isolation_scope", |
@@ -430,15 +429,6 @@ def get_current_span( |
430 | 429 | return tracing_utils.get_current_span(scope) |
431 | 430 |
|
432 | 431 |
|
433 | | -def get_current_streamed_span( |
434 | | - scope: "Optional[Scope]" = None, |
435 | | -) -> "Optional[StreamedSpan]": |
436 | | - """ |
437 | | - Returns the currently active streamed span if there is one running, otherwise `None` |
438 | | - """ |
439 | | - return tracing_utils.get_current_streamed_span(scope) |
440 | | - |
441 | | - |
442 | 432 | def get_traceparent() -> "Optional[str]": |
443 | 433 | """ |
444 | 434 | Returns the traceparent either from the active span or from the scope. |
@@ -543,7 +533,7 @@ def update_current_span( |
543 | 533 | attributes={"user_id": 123, "batch_size": 50} |
544 | 534 | ) |
545 | 535 | """ |
546 | | - if isinstance(get_current_streamed_span(), StreamedSpan): |
| 536 | + if isinstance(_get_current_streamed_span(), StreamedSpan): |
547 | 537 | warnings.warn( |
548 | 538 | "The `update_current_span` API isn't available in streaming mode. " |
549 | 539 | "Retrieve the current span with get_current_span() and use its API " |
|
0 commit comments