You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TracerProvider: we can think of this as the agent instance. Only one can exist
41
-
# SpanProcessor: we can think of this as an application. In NR, we can have multiple applications
42
-
# though right now, we can only do SpanProcessor and SynchronousMultiSpanProcessor
43
-
# Tracer: we can think of this as the transaction.
44
-
# Span: we can think of this as the trace.
45
-
# Links functionality has now been enabled but not implemented yet. Links are relationships
46
-
# between spans, but lateral in hierarchy. In NR we only have parent-child relationships.
47
-
# We may want to preserve this information with a custom attribute. We can also add this
48
-
# as a new attribute in a trace, but it will still not be seen in the UI other than a trace
49
-
# attribute.
50
-
51
102
52
103
classSpan(otel_api_trace.Span):
53
104
def__init__(
@@ -73,11 +124,6 @@ def __init__(
73
124
self.nr_trace=None
74
125
self.instrumenting_module=instrumenting_module
75
126
76
-
# Do not create a New Relic trace if parent
77
-
# is a remote span and it is not sampled
78
-
ifself._remote() andnotself._sampled():
79
-
return
80
-
81
127
self.nr_parent=None
82
128
current_nr_trace=current_trace()
83
129
if (
@@ -100,7 +146,7 @@ def __init__(
100
146
_logger.error(
101
147
"OpenTelemetry span (%s) and NR trace (%s) do not match nor correspond to a remote span. Open Telemetry span will not be reported to New Relic. Please report this problem to New Relic.",
102
148
self.otel_parent,
103
-
current_nr_trace,
149
+
current_nr_trace,# NR parent trace
104
150
)
105
151
return
106
152
@@ -140,26 +186,6 @@ def __init__(
140
186
141
187
self.nr_trace.__enter__()
142
188
143
-
def_sampled(self):
144
-
# Uses NR to determine if the trace is sampled
145
-
#
146
-
# transaction.sampled can be `None`, `True`, `False`.
147
-
# If `None`, this has not been computed by NR which
148
-
# can also mean the following:
149
-
# 1. There was not a context passed in that explicitly has sampling disabled.
150
-
# This flag would be found in the traceparent or traceparent and tracespan headers.
151
-
# 2. Transaction was not created where DT headers are accepted during __init__
152
-
# Therefore, we will treat a value of `None` as `True` for now.
153
-
#
154
-
# The primary reason for this behavior is because Otel expects to
155
-
# only be able to record information like events and attributes
0 commit comments