Skip to content

Commit 008a7e8

Browse files
authored
Fix removal of process attr call (#1550)
1 parent 48c4420 commit 008a7e8

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

newrelic/core/attribute.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"response.headers.contentType",
101101
"response.status",
102102
"server.address",
103+
"server.port",
103104
"zeebe.client.bpmnProcessId",
104105
"zeebe.client.messageName",
105106
"zeebe.client.correlationKey",

newrelic/core/database_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def trace_node(self, stats, root, connections):
279279
start_time=start_time, end_time=end_time, name=name, params=params, children=children, label=None
280280
)
281281

282-
def span_event(self, *args, **kwargs):
282+
def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict):
283283
sql = self.formatted
284284

285285
if sql:
@@ -288,4 +288,4 @@ def span_event(self, *args, **kwargs):
288288

289289
self.agent_attributes["db.statement"] = sql
290290

291-
return super().span_event(*args, **kwargs)
291+
return super().span_event(settings, base_attrs=base_attrs, parent_guid=parent_guid, attr_class=attr_class)

newrelic/core/external_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic
175175
i_attrs = (base_attrs and base_attrs.copy()) or attr_class()
176176
i_attrs["category"] = "http"
177177
i_attrs["span.kind"] = "client"
178-
i_attrs["component"] = self.library
178+
_, i_attrs["component"] = attribute.process_user_attribute("component", self.library)
179179

180180
if self.method:
181-
i_attrs["http.method"] = self.method
181+
_, i_attrs["http.method"] = attribute.process_user_attribute("http.method", self.method)
182182

183183
return super().span_event(settings, base_attrs=i_attrs, parent_guid=parent_guid, attr_class=attr_class)

newrelic/core/node_mixin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,22 @@ def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dic
117117
i_attrs["span.kind"] = "client"
118118

119119
if self.product:
120-
i_attrs["component"] = a_attrs["db.system"] = self.product
120+
i_attrs["component"] = a_attrs["db.system"] = attribute.process_user_attribute("db.system", self.product)[1]
121121
if self.operation:
122-
a_attrs["db.operation"] = self.operation
122+
a_attrs["db.operation"] = attribute.process_user_attribute("db.operation", self.operation)[1]
123123
if self.target:
124-
a_attrs["db.collection"] = self.target
124+
a_attrs["db.collection"] = attribute.process_user_attribute("db.collection", self.target)[1]
125125

126126
if self.instance_hostname:
127-
peer_hostname = self.instance_hostname
127+
peer_hostname = attribute.process_user_attribute("peer.hostname", self.instance_hostname)[1]
128128
else:
129129
peer_hostname = "Unknown"
130130

131131
a_attrs["peer.hostname"] = a_attrs["server.address"] = peer_hostname
132132

133133
peer_address = f"{peer_hostname}:{self.port_path_or_id or 'Unknown'}"
134134

135-
a_attrs["peer.address"] = peer_address
135+
a_attrs["peer.address"] = attribute.process_user_attribute("peer.address", peer_address)[1]
136136

137137
# Attempt to treat port_path_or_id as an integer, fallback to not including it
138138
try:

0 commit comments

Comments
 (0)