@@ -120,7 +120,7 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
120120
121121 weak_handler = weakref .ref (self )
122122 client = sentry_sdk .get_client ()
123- span_streaming = has_span_streaming_enabled (client .options )
123+ is_span_streaming_enabled = has_span_streaming_enabled (client .options )
124124
125125 with sentry_sdk .isolation_scope () as scope :
126126 headers = self .request .headers
@@ -131,7 +131,7 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
131131
132132 span_ctx : "ContextManager[Union[Span, StreamedSpan, None]]"
133133
134- if span_streaming :
134+ if is_span_streaming_enabled :
135135 sentry_sdk .traces .continue_trace (dict (headers ))
136136 scope .set_custom_sampling_context ({"tornado_request" : self .request })
137137
@@ -142,6 +142,7 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
142142 "sentry.origin" : TornadoIntegration .origin ,
143143 "sentry.span.source" : SegmentSource .ROUTE ,
144144 },
145+ parent_span = None ,
145146 )
146147 else :
147148 transaction = continue_trace (
@@ -168,12 +169,12 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
168169
169170 method = getattr (self , self .request .method .lower (), None )
170171 if method is not None :
171- tx_name = transaction_from_function (method ) or ""
172- if tx_name :
173- span .name = tx_name
172+ span_name = transaction_from_function (method ) or ""
173+ if span_name :
174+ span .name = span_name
174175 span .set_attribute (
175176 "sentry.span.source" ,
176- SegmentSource .COMPONENT . value ,
177+ SegmentSource .COMPONENT ,
177178 )
178179
179180 try :
0 commit comments