File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,6 @@ def _span_to_transport_format(span):
151151 for (k , v ) in span ._attributes .items ()
152152 }
153153
154- # We set these as late as possible to increase the odds of the span
155- # getting a good segment name
156- res ["attributes" ]["sentry.segment.id" ] = span .containing_transaction .span_id
157- res ["attributes" ]["sentry.segment.name" ] = span .containing_transaction .name
158-
159154 return res
160155
161156 def _flush (self ):
Original file line number Diff line number Diff line change 2828 logger ,
2929 get_before_send_log ,
3030 get_before_send_metric ,
31+ get_default_attributes ,
3132 has_logs_enabled ,
3233 has_metrics_enabled ,
3334)
@@ -943,6 +944,12 @@ def _capture_span(self, span):
943944 if not has_span_streaming_enabled (self .options ):
944945 return
945946
947+ attributes = get_default_attributes ()
948+ span ._attributes = attributes | span ._attributes
949+
950+ span ._attributes ["sentry.segment.id" ] = span .containing_transaction .span_id
951+ span ._attributes ["sentry.segment.name" ] = span .containing_transaction .name
952+
946953 self ._span_batcher .add (span )
947954
948955 def _capture_log (self , log ):
Original file line number Diff line number Diff line change 1414 nanosecond_time ,
1515 should_be_treated_as_error ,
1616 serialize_attribute ,
17- get_default_attributes ,
1817)
1918
2019from typing import TYPE_CHECKING
@@ -355,11 +354,6 @@ def __init__(
355354
356355 self .update_active_thread ()
357356 self .set_profiler_id (get_profiler_id ())
358- self ._set_initial_attributes ()
359-
360- def _set_initial_attributes (self ):
361- attributes = get_default_attributes ()
362- self ._attributes = attributes | self ._attributes
363357
364358 # TODO this should really live on the Transaction class rather than the Span
365359 # class
You can’t perform that action at this time.
0 commit comments