|
15 | 15 | from sentry_sdk.scope import should_send_default_pii, use_isolation_scope |
16 | 16 | from sentry_sdk.sessions import track_session |
17 | 17 | from sentry_sdk.traces import StreamedSpan, SegmentSource |
18 | | -from sentry_sdk.tracing import Transaction, TransactionSource |
| 18 | +from sentry_sdk.tracing import Span, TransactionSource |
19 | 19 | from sentry_sdk.tracing_utils import has_span_streaming_enabled |
20 | 20 | from sentry_sdk.utils import ( |
21 | 21 | ContextVar, |
@@ -127,13 +127,13 @@ def __call__( |
127 | 127 |
|
128 | 128 | method = environ.get("REQUEST_METHOD", "").upper() |
129 | 129 |
|
130 | | - span_ctx: "ContextManager[Union[Transaction, StreamedSpan, None]]" = None |
| 130 | + span_ctx: "Optional[ContextManager[Union[Span, StreamedSpan, None]]]" = None |
131 | 131 | if method in self.http_methods_to_capture: |
132 | 132 | if span_streaming: |
133 | 133 | sentry_sdk.traces.continue_trace( |
134 | 134 | dict(_get_headers(environ)) |
135 | 135 | ) |
136 | | - scope.set_custom_sampling_context({"wsgi_environ": scope}) |
| 136 | + scope.set_custom_sampling_context({"wsgi_environ": environ}) |
137 | 137 |
|
138 | 138 | span_ctx = sentry_sdk.traces.start_span( |
139 | 139 | name=_DEFAULT_TRANSACTION_NAME, |
@@ -222,7 +222,7 @@ def __call__( |
222 | 222 |
|
223 | 223 | def _sentry_start_response( |
224 | 224 | old_start_response: "StartResponse", |
225 | | - span: "Optional[Union[Transaction, StreamedSpan]]", |
| 225 | + span: "Optional[Union[Span, StreamedSpan]]", |
226 | 226 | status: str, |
227 | 227 | response_headers: "WsgiResponseHeaders", |
228 | 228 | exc_info: "Optional[WsgiExcInfo]" = None, |
|
0 commit comments