@@ -361,10 +361,6 @@ def _set_initial_attributes(self):
361361 attributes = get_default_attributes ()
362362 self ._attributes = attributes | self ._attributes
363363
364- self ._attributes ["sentry.segment.id" ] = self .containing_transaction .span_id
365- # TODO[span-first]: This might need to be updated if the segment name is updated
366- self ._attributes ["sentry.segment.name" ] = self .containing_transaction .name
367-
368364 # TODO this should really live on the Transaction class rather than the Span
369365 # class
370366 def init_span_recorder (self , maxlen ):
@@ -753,7 +749,7 @@ def finish(self, scope=None, end_timestamp=None):
753749 and self .containing_transaction .sampled
754750 ):
755751 logger .debug (f"[Tracing] Adding span { self .span_id } to buffer" )
756- client ._span_batcher . add (self )
752+ client ._capture_span (self )
757753
758754 return None
759755
@@ -1121,9 +1117,10 @@ def finish(
11211117
11221118 return None
11231119
1124- if self ._mode == "stream" and self .containing_transaction .sampled :
1125- logger .debug (f"[Tracing] Adding span { self .span_id } to buffer" )
1126- client ._span_batcher .add (self )
1120+ if self ._mode == "stream" :
1121+ if self .containing_transaction .sampled :
1122+ logger .debug (f"[Tracing] Adding span { self .span_id } to batcher" )
1123+ client ._capture_span (self )
11271124 return
11281125
11291126 finished_spans = [
@@ -1167,7 +1164,6 @@ def finish(
11671164 self ._profile = None
11681165
11691166 event ["measurements" ] = self ._measurements
1170-
11711167 return scope .capture_event (event )
11721168
11731169 def set_measurement (self , name , value , unit = "" ):
0 commit comments