@@ -113,7 +113,7 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
113113
114114 weak_handler = weakref .ref (self )
115115 client = sentry_sdk .get_client ()
116- span_streaming = has_span_streaming_enabled (client .options )
116+ is_span_streaming_enabled = has_span_streaming_enabled (client .options )
117117
118118 with sentry_sdk .isolation_scope () as scope :
119119 headers = self .request .headers
@@ -124,7 +124,7 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
124124
125125 span_ctx : "ContextManager[Union[Span, StreamedSpan, None]]"
126126
127- if span_streaming :
127+ if is_span_streaming_enabled :
128128 sentry_sdk .traces .continue_trace (dict (headers ))
129129 scope .set_custom_sampling_context ({"tornado_request" : self .request })
130130
@@ -135,6 +135,7 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
135135 "sentry.origin" : TornadoIntegration .origin ,
136136 "sentry.span.source" : SegmentSource .ROUTE ,
137137 },
138+ parent_span = None ,
138139 )
139140 else :
140141 transaction = continue_trace (
@@ -161,12 +162,12 @@ def _handle_request_impl(self: "RequestHandler") -> "Generator[None, None, None]
161162
162163 method = getattr (self , self .request .method .lower (), None )
163164 if method is not None :
164- tx_name = transaction_from_function (method ) or ""
165- if tx_name :
166- span .name = tx_name
165+ span_name = transaction_from_function (method ) or ""
166+ if span_name :
167+ span .name = span_name
167168 span .set_attribute (
168169 "sentry.span.source" ,
169- SegmentSource .COMPONENT . value ,
170+ SegmentSource .COMPONENT ,
170171 )
171172
172173 try :
0 commit comments