Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newrelic/core/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"response.headers.contentType",
"response.status",
"server.address",
"server.port",
"zeebe.client.bpmnProcessId",
"zeebe.client.messageName",
"zeebe.client.correlationKey",
Expand Down
4 changes: 2 additions & 2 deletions newrelic/core/database_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
4 changes: 2 additions & 2 deletions newrelic/core/external_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 5 additions & 5 deletions newrelic/core/node_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,22 @@ 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"

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

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:
Expand Down
Loading