2222)
2323from sentry_sdk .tracing_utils import (
2424 Baggage ,
25- has_tracing_enabled ,
2625)
2726from sentry_sdk .utils import (
2827 capture_internal_exceptions ,
3534
3635if TYPE_CHECKING :
3736 from typing import Any , Callable , Iterator , Optional , ParamSpec , TypeVar , Union
38- from sentry_sdk ._types import Attributes , AttributeValue , SamplingContext
37+ from sentry_sdk ._types import Attributes , AttributeValue
3938 from sentry_sdk .profiler .continuous_profiler import ContinuousProfile
4039
4140 P = ParamSpec ("P" )
@@ -237,10 +236,10 @@ class StreamedSpan:
237236 "_status" ,
238237 "_scope" ,
239238 "_previous_span_on_scope" ,
240- "_continuous_profile" ,
241239 "_baggage" ,
242240 "_sample_rand" ,
243241 "_sample_rate" ,
242+ "_continuous_profile" ,
244243 )
245244
246245 def __init__ (
@@ -530,10 +529,6 @@ def _update_active_thread(self) -> None:
530529 if thread_name is not None :
531530 self .set_attribute (SPANDATA .THREAD_NAME , thread_name )
532531
533- def _set_profile_id (self , profiler_id : "Optional[str]" ) -> None :
534- if profiler_id is not None :
535- self .set_attribute ("sentry.profiler_id" , profiler_id )
536-
537532 def _get_trace_context (self ) -> "dict[str, Any]" :
538533 # Even if spans themselves are not event-based anymore, we need this
539534 # to populate trace context on events
@@ -551,6 +546,10 @@ def _get_trace_context(self) -> "dict[str, Any]":
551546
552547 return context
553548
549+ def _set_profile_id (self , profiler_id : "Optional[str]" ) -> None :
550+ if profiler_id is not None :
551+ self .set_attribute ("sentry.profiler_id" , profiler_id )
552+
554553 def _start_profile (self ) -> None :
555554 if not self ._is_segment ():
556555 return
0 commit comments