@@ -57,11 +57,11 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic
57
57
ct_exit_spans = {}
58
58
i_attrs = base_attrs and base_attrs .copy () or attr_class ()
59
59
i_attrs ["type" ] = "Span"
60
- i_attrs ["name" ] = self .name
60
+ i_attrs ["name" ] = i_attrs . get ( "name" ) or self .name
61
61
i_attrs ["guid" ] = self .guid
62
62
i_attrs ["timestamp" ] = int (self .start_time * 1000 )
63
63
i_attrs ["duration" ] = self .duration
64
- i_attrs ["category" ] = "generic"
64
+ i_attrs ["category" ] = i_attrs . get ( "category" ) or "generic"
65
65
# TODO: limit intrinsic attributes but this likely requires changes in the pipeline.
66
66
#if settings.distributed_tracing.minimize_attributes.enabled:
67
67
# i_ct_attrs = {"type", "name", "guid", "parentId", "transaction.name", "traceId", "timestamp", "duration", "nr.entryPoint", "transactionId"}
@@ -86,7 +86,7 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic
86
86
if settings .distributed_tracing .drop_inprocess_spans .enabled or settings .distributed_tracing .unique_spans .enabled :
87
87
exit_span_attrs_present = attribute .SPAN_ENTITY_RELATIONSHIP_ATTRIBUTES & set (a_attrs )
88
88
# If this is the entry node, always return it.
89
- if self . __class__ . __name__ == "RootNode" :
89
+ if i_attrs . get ( "nr.entryPoint" ) :
90
90
ct_processing_time [0 ] += (time .time () - start_time )
91
91
return [i_attrs , u_attrs , {}] if settings .distributed_tracing .minimize_attributes .enabled else [i_attrs , u_attrs , a_attrs ]
92
92
# If the span is not an exit span, skip it by returning None.
@@ -192,4 +192,4 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic
192
192
except Exception :
193
193
pass
194
194
195
- return super ().span_event (settings , base_attrs = base_attrs , parent_guid = parent_guid , attr_class = attr_class , * args , ** kwargs )
195
+ return super ().span_event (settings , i_attrs = base_attrs , parent_guid = parent_guid , attr_class = attr_class , * args , ** kwargs )
0 commit comments