Skip to content

Commit 7781c71

Browse files
committed
Fix linter errors
1 parent 674dffd commit 7781c71

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

newrelic/api/opentelemetry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(
8585
resource=None,
8686
attributes=None,
8787
kind=otel_api_trace.SpanKind.INTERNAL,
88-
nr_transaction=current_transaction(), # This attribute is purely to prevent garbage collection
88+
nr_transaction=None,
8989
nr_trace_type=FunctionTrace,
9090
instrumenting_module=None,
9191
*args,
@@ -95,7 +95,7 @@ def __init__(
9595
self.otel_parent = parent
9696
self.attributes = attributes or {}
9797
self.kind = kind
98-
self.nr_transaction = nr_transaction
98+
self.nr_transaction = nr_transaction or current_transaction() # This attribute is purely to prevent garbage collection
9999
self.nr_trace = None
100100
self.instrumenting_module = instrumenting_module
101101

newrelic/hooks/hybridagent_opentelemetry.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def wrap_start_internal_or_server_span(wrapped, instance, args, kwargs):
123123
if context_carrier:
124124
if ("HTTP_HOST" in context_carrier) or ("http_version" in context_carrier):
125125
# This is an HTTP request (WSGI, ASGI, or otherwise)
126+
nr_environ = context_carrier.copy()
126127
attributes["nr.http.headers"] = nr_environ
127128

128129
else:

tests/hybridagent_opentelemetry/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from opentelemetry import trace
1616

1717
from newrelic.api.opentelemetry import TracerProvider
18-
from testing_support.fixtures import ( # noqa: F401; pylint: disable=W0611
18+
from testing_support.fixtures import ( # noqa: F401
1919
collector_agent_registration_fixture,
2020
collector_available_fixture,
2121
)

0 commit comments

Comments
 (0)