Skip to content

Commit 63d939b

Browse files
committed
Fixup
1 parent 03e092f commit 63d939b

File tree

6 files changed

+18
-52
lines changed

6 files changed

+18
-52
lines changed

THIRD_PARTY_NOTICES.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,3 @@ Distributed under the following license(s):
6262

6363
* [The BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause)
6464

65-
## [objsize](https://pypi.org/project/objsize)
66-
67-
Copyright (c) 2006-2025, Liran Funaro
68-
All rights reserved.
69-
70-
Distributed under the following license(s):
71-
72-
* [The BSD 3-Clause "New" or "Revised" License](http://opensource.org/licenses/BSD-3-Clause)

newrelic/core/external_node.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,15 @@ def trace_node(self, stats, root, connections):
169169
start_time=start_time, end_time=end_time, name=name, params=params, children=children, label=None
170170
)
171171

172-
def span_event(self, *args, **kwargs):
172+
def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict, *args, **kwargs):
173173
self.agent_attributes["http.url"] = self.http_url
174-
attrs = super().span_event(*args, **kwargs)
175-
if not attrs:
176-
return None
177-
i_attrs = attrs[0]
178174

175+
i_attrs = base_attrs and base_attrs.copy() or attr_class()
179176
i_attrs["category"] = "http"
180177
i_attrs["span.kind"] = "client"
181178
_, i_attrs["component"] = attribute.process_user_attribute("component", self.library)
182179

183180
if self.method:
184181
_, i_attrs["http.method"] = attribute.process_user_attribute("http.method", self.method)
185182

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

newrelic/core/function_node.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,8 @@ def trace_node(self, stats, root, connections):
114114
start_time=start_time, end_time=end_time, name=name, params=params, children=children, label=self.label
115115
)
116116

117-
def span_event(self, *args, **kwargs):
118-
attrs = super().span_event(*args, **kwargs)
119-
if not attrs:
120-
return None
121-
i_attrs = attrs[0]
122-
117+
def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict, *args, **kwargs):
118+
i_attrs = base_attrs and base_attrs.copy() or attr_class()
123119
i_attrs["name"] = f"{self.group}/{self.name}"
124120

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

newrelic/core/loop_node.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,8 @@ def trace_node(self, stats, root, connections):
7979
start_time=start_time, end_time=end_time, name=name, params=params, children=children, label=None
8080
)
8181

82-
def span_event(self, *args, **kwargs):
83-
attrs = super().span_event(*args, **kwargs)
84-
if not attrs:
85-
return None
86-
i_attrs = attrs[0]
87-
82+
def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict, *args, **kwargs):
83+
i_attrs = base_attrs and base_attrs.copy() or attr_class()
8884
i_attrs["name"] = f"EventLoop/Wait/{self.name}"
8985

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

newrelic/core/node_mixin.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,10 @@ def db_instance(self):
149149
self._db_instance = db_instance_attr
150150
return db_instance_attr
151151

152-
def span_event(self, *args, **kwargs):
153-
self.agent_attributes["db.instance"] = self.db_instance
154-
attrs = super().span_event(*args, **kwargs)
155-
i_attrs = attrs[0]
156-
a_attrs = attrs[2]
152+
def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict, *args, **kwargs):
153+
a_attrs = self.agent_attributes
154+
a_attrs["db.instance"] = self.db_instance
155+
i_attrs = base_attrs and base_attrs.copy() or attr_class()
157156

158157
i_attrs["category"] = "datastore"
159158
i_attrs["span.kind"] = "client"
@@ -182,18 +181,4 @@ def span_event(self, *args, **kwargs):
182181
except Exception:
183182
pass
184183

185-
# intrinsics, user attrs, agent attrs
186-
if settings.core_tracing.drop_inprocess_spans or settings.core_tracing.enabled:
187-
if not parent_guid:
188-
return [i_attrs, u_attrs, a_attrs]
189-
set_inprocess_attrs = set(attribute.SPAN_ENTITY_RELATIONSHIP_ATTRIBUTES)
190-
set_a_attrs = set(a_attrs)
191-
exit_span_attrs_present = set_inprocess_attrs & set_a_attrs
192-
attrs[3] = exit_span_attrs_present
193-
if not exit_span_attrs_present:
194-
return None
195-
set_inprocess_attrs = set(attribute.SPAN_ENTITY_RELATIONSHIP_ATTRIBUTES)
196-
set_a_attrs = set(a_attrs)
197-
exit_span_attrs_present = set_inprocess_attrs & set_a_attrs
198-
attrs[3] = exit_span_attrs_present
199-
return attrs
184+
return super().span_event(settings, base_attrs=base_attrs, parent_guid=parent_guid, attr_class=attr_class, *args, **kwargs)

newrelic/core/root_node.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737

3838

3939
class RootNode(_RootNode, GenericNodeMixin):
40-
def span_event(self, *args, **kwargs):
41-
span = super().span_event(*args, **kwargs)
42-
i_attrs = span[0]
40+
def span_event(self, settings, base_attrs=None, parent_guid=None, attr_class=dict, *args, **kwargs):
41+
i_attrs = base_attrs and base_attrs.copy() or attr_class()
4342
i_attrs["transaction.name"] = self.path
4443
i_attrs["nr.entryPoint"] = True
4544
if self.trusted_parent_span:
4645
i_attrs["trustedParentId"] = self.trusted_parent_span
4746
if self.tracing_vendors:
4847
i_attrs["tracingVendors"] = self.tracing_vendors
49-
return span
48+
49+
return super().span_event(settings, base_attrs=base_attrs, parent_guid=parent_guid, attr_class=attr_class, *args, **kwargs)
5050

5151
def trace_node(self, stats, root, connections):
5252
name = self.path

0 commit comments

Comments
 (0)