@@ -230,7 +230,6 @@ class StreamedSpan:
230230 "_trace_id" ,
231231 "_parent_span_id" ,
232232 "_segment" ,
233- "_sampled" ,
234233 "_parent_sampled" ,
235234 "_start_timestamp" ,
236235 "_start_timestamp_monotonic_ns" ,
@@ -600,14 +599,6 @@ def __exit__(
600599 ) -> None :
601600 self ._end ()
602601
603- @property
604- def name (self ) -> str :
605- return ""
606-
607- @name .setter
608- def name (self , value : str ) -> None :
609- pass
610-
611602 def _start (self ) -> None :
612603 if self ._scope is None :
613604 return
@@ -652,20 +643,20 @@ def finish(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> No
652643
653644 self ._end ()
654645
655- # XXX[span-first]: These default span_id and trace_id values will be used
656- # in outgoing requests if a noop span is active. Is that how it should be?
646+ def get_attributes ( self ) -> "Attributes" :
647+ return {}
657648
658- @property
659- def span_id (self ) -> str :
660- return "0000000000000000"
649+ def set_attribute (self , key : str , value : "AttributeValue" ) -> None :
650+ pass
661651
662- @property
663- def trace_id (self ) -> str :
664- return "00000000000000000000000000000000"
652+ def set_attributes (self , attributes : "Attributes" ) -> None :
653+ pass
665654
666- @property
667- def sampled (self ) -> "Optional[bool]" :
668- return False
655+ def remove_attribute (self , key : str ) -> None :
656+ pass
657+
658+ def _is_segment (self ) -> bool :
659+ return self ._scope is not None
669660
670661 @property
671662 def status (self ) -> "str" :
@@ -676,30 +667,31 @@ def status(self, status: "Union[SpanStatus, str]") -> None:
676667 pass
677668
678669 @property
679- def active (self ) -> bool :
680- return True
681-
682- def get_attributes (self ) -> "Attributes" :
683- return {}
670+ def name (self ) -> str :
671+ return ""
684672
685- def set_attribute (self , key : str , value : "AttributeValue" ) -> None :
673+ @name .setter
674+ def name (self , value : str ) -> None :
686675 pass
687676
688- def set_attributes (self , attributes : "Attributes" ) -> None :
689- pass
677+ @property
678+ def active (self ) -> bool :
679+ return True
690680
691- def remove_attribute ( self , key : str ) -> None :
692- pass
681+ # XXX[span-first]: These default span_id and trace_id values will be used
682+ # in outgoing requests if a noop span is active. Is that how it should be?
693683
694- def _is_segment (self ) -> bool :
695- return self ._scope is not None
684+ @property
685+ def span_id (self ) -> str :
686+ return "0000000000000000"
696687
697- def _to_traceparent (self ) -> str :
698- propagation_context = (
699- sentry_sdk .get_current_scope ().get_active_propagation_context ()
700- )
688+ @property
689+ def trace_id (self ) -> str :
690+ return "00000000000000000000000000000000"
701691
702- return f"{ propagation_context .trace_id } -{ propagation_context .span_id } -0"
692+ @property
693+ def sampled (self ) -> "Optional[bool]" :
694+ return False
703695
704696 @property
705697 def start_timestamp (self ) -> "Optional[datetime]" :
@@ -709,6 +701,13 @@ def start_timestamp(self) -> "Optional[datetime]":
709701 def timestamp (self ) -> "Optional[datetime]" :
710702 return None
711703
704+ def _to_traceparent (self ) -> str :
705+ propagation_context = (
706+ sentry_sdk .get_current_scope ().get_active_propagation_context ()
707+ )
708+
709+ return f"{ propagation_context .trace_id } -{ propagation_context .span_id } -0"
710+
712711
713712def trace (
714713 func : "Optional[Callable[P, R]]" = None ,
0 commit comments