@@ -57,11 +57,11 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic
5757 ct_exit_spans = {}
5858 i_attrs = base_attrs and base_attrs .copy () or attr_class ()
5959 i_attrs ["type" ] = "Span"
60- i_attrs ["name" ] = self .name
60+ i_attrs ["name" ] = i_attrs . get ( "name" ) or self .name
6161 i_attrs ["guid" ] = self .guid
6262 i_attrs ["timestamp" ] = int (self .start_time * 1000 )
6363 i_attrs ["duration" ] = self .duration
64- i_attrs ["category" ] = "generic"
64+ i_attrs ["category" ] = i_attrs . get ( "category" ) or "generic"
6565 # TODO: limit intrinsic attributes but this likely requires changes in the pipeline.
6666 #if settings.distributed_tracing.minimize_attributes.enabled:
6767 # 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
8686 if settings .distributed_tracing .drop_inprocess_spans .enabled or settings .distributed_tracing .unique_spans .enabled :
8787 exit_span_attrs_present = attribute .SPAN_ENTITY_RELATIONSHIP_ATTRIBUTES & set (a_attrs )
8888 # If this is the entry node, always return it.
89- if self . __class__ . __name__ == "RootNode" :
89+ if i_attrs . get ( "nr.entryPoint" ) :
9090 ct_processing_time [0 ] += (time .time () - start_time )
9191 return [i_attrs , u_attrs , {}] if settings .distributed_tracing .minimize_attributes .enabled else [i_attrs , u_attrs , a_attrs ]
9292 # 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
192192 except Exception :
193193 pass
194194
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