From 80efa9e6d7ba742f203634b4bd12704178f631f9 Mon Sep 17 00:00:00 2001 From: Hannah Stepanek Date: Wed, 22 Oct 2025 19:01:30 -0700 Subject: [PATCH] Fix removal of process attr call --- newrelic/core/attribute.py | 1 + newrelic/core/database_node.py | 4 ++-- newrelic/core/external_node.py | 4 ++-- newrelic/core/node_mixin.py | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/newrelic/core/attribute.py b/newrelic/core/attribute.py index 79b9a56cb2..785a2fa0ec 100644 --- a/newrelic/core/attribute.py +++ b/newrelic/core/attribute.py @@ -100,6 +100,7 @@ "response.headers.contentType", "response.status", "server.address", + "server.port", "zeebe.client.bpmnProcessId", "zeebe.client.messageName", "zeebe.client.correlationKey", diff --git a/newrelic/core/database_node.py b/newrelic/core/database_node.py index 7c4032c5b9..1f60add195 100644 --- a/newrelic/core/database_node.py +++ b/newrelic/core/database_node.py @@ -279,7 +279,7 @@ def trace_node(self, stats, root, connections): start_time=start_time, end_time=end_time, name=name, params=params, children=children, label=None ) - def span_event(self, *args, **kwargs): + def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict): sql = self.formatted if sql: @@ -288,4 +288,4 @@ def span_event(self, *args, **kwargs): self.agent_attributes["db.statement"] = sql - return super().span_event(*args, **kwargs) + return super().span_event(settings, base_attrs=base_attrs, parent_guid=parent_guid, attr_class=attr_class) diff --git a/newrelic/core/external_node.py b/newrelic/core/external_node.py index bd0fde04f6..f47d634b3d 100644 --- a/newrelic/core/external_node.py +++ b/newrelic/core/external_node.py @@ -175,9 +175,9 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic i_attrs = (base_attrs and base_attrs.copy()) or attr_class() i_attrs["category"] = "http" i_attrs["span.kind"] = "client" - i_attrs["component"] = self.library + _, i_attrs["component"] = attribute.process_user_attribute("component", self.library) if self.method: - i_attrs["http.method"] = self.method + _, i_attrs["http.method"] = attribute.process_user_attribute("http.method", self.method) return super().span_event(settings, base_attrs=i_attrs, parent_guid=parent_guid, attr_class=attr_class) diff --git a/newrelic/core/node_mixin.py b/newrelic/core/node_mixin.py index 699a2d1118..9154cc8765 100644 --- a/newrelic/core/node_mixin.py +++ b/newrelic/core/node_mixin.py @@ -117,14 +117,14 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic i_attrs["span.kind"] = "client" if self.product: - i_attrs["component"] = a_attrs["db.system"] = self.product + i_attrs["component"] = a_attrs["db.system"] = attribute.process_user_attribute("db.system", self.product)[1] if self.operation: - a_attrs["db.operation"] = self.operation + a_attrs["db.operation"] = attribute.process_user_attribute("db.operation", self.operation)[1] if self.target: - a_attrs["db.collection"] = self.target + a_attrs["db.collection"] = attribute.process_user_attribute("db.collection", self.target)[1] if self.instance_hostname: - peer_hostname = self.instance_hostname + peer_hostname = attribute.process_user_attribute("peer.hostname", self.instance_hostname)[1] else: peer_hostname = "Unknown" @@ -132,7 +132,7 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic peer_address = f"{peer_hostname}:{self.port_path_or_id or 'Unknown'}" - a_attrs["peer.address"] = peer_address + a_attrs["peer.address"] = attribute.process_user_attribute("peer.address", peer_address)[1] # Attempt to treat port_path_or_id as an integer, fallback to not including it try: