@@ -625,8 +625,6 @@ def _to_json(self) -> "SpanJSON":
625625
626626class NoOpStreamedSpan (StreamedSpan ):
627627 __slots__ = (
628- "_noop_name" ,
629- "_segment_source" ,
630628 "_sampled" ,
631629 "_finished" ,
632630 "_unsampled_reason" ,
@@ -647,10 +645,12 @@ def __init__(
647645 sample_rand : "Optional[float]" = None ,
648646 sample_rate : "Optional[float]" = None ,
649647 ) -> None :
650- self ._noop_name = name
651- self ._segment_source : "Optional[AttributeValue]" = None
652- if attributes is not None :
653- self ._segment_source = attributes .get ("sentry.segment.name.source" )
648+ self ._name = name # type: ignore[assignment]
649+ self ._attributes = {}
650+ if attributes is not None and "sentry.segment.name.source" in attributes :
651+ self .set_attribute (
652+ "sentry.segment.name.source" , attributes ["sentry.segment.name.source" ]
653+ )
654654
655655 self ._span_id : "Optional[str]" = None
656656
@@ -733,14 +733,14 @@ def set_attribute(self, key: str, value: "AttributeValue") -> None:
733733 if key != "sentry.segment.name.source" :
734734 return
735735
736- self ._segment_source = value
736+ self .set_attribute ( "sentry.segment.name.source" , value )
737737
738738 def set_attributes (self , attributes : "Attributes" ) -> None :
739739 for key , value in attributes .items ():
740740 if key != "sentry.segment.name.source" :
741741 continue
742742
743- self ._segment_source = value
743+ self .set_attribute ( "sentry.segment.name.source" , value )
744744
745745 def remove_attribute (self , key : str ) -> None :
746746 pass
@@ -755,11 +755,11 @@ def status(self, status: "Union[SpanStatus, str]") -> None:
755755
756756 @property
757757 def name (self ) -> str :
758- return self ._noop_name or ""
758+ return self ._name or ""
759759
760760 @name .setter
761761 def name (self , name : str ) -> None :
762- self ._noop_name = name
762+ self ._name = name
763763
764764 @property
765765 def active (self ) -> bool :
0 commit comments