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
Copy file name to clipboardExpand all lines: sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/aws_xray_ids_generator.py
+1-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@
18
18
fromopentelemetryimporttrace
19
19
20
20
21
-
classAWSXRayIdsGenerator(trace.IdsGenerator):
21
+
classAwsXRayIdsGenerator(trace.IdsGenerator):
22
22
"""Generates tracing IDs compatible with the AWS X-Ray tracing service. In
23
23
the X-Ray system, the first 32 bits of the `TraceId` are the Unix epoch time
24
24
in seconds. Since spans (AWS calls them segments) with an embedded timestamp
Copy file name to clipboardExpand all lines: sdk-extension/opentelemetry-sdk-extension-aws/src/opentelemetry/sdk/extension/aws/trace/propagation/aws_xray_format.py
+53-18
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@
28
28
_logger=logging.getLogger(__name__)
29
29
30
30
31
-
classAWSXRayFormat(TextMapPropagator):
31
+
classAwsXRayFormat(TextMapPropagator):
32
32
"""Propagator for the AWS X-Ray Trace Header propagation protocol.
_logger.error(("Invalid Sampling flag in X-Ray trace header: '%s' with value '%s'. Returning INVALID span context.", self.TRACE_HEADER_KEY, trace_header))
132
-
returntrace.INVALID_SPAN_CONTEXT
163
+
returntrace.set_span_in_context(
164
+
trace.INVALID_SPAN,
165
+
context=context
166
+
)
133
167
134
168
options=0
135
169
ifsampled:
@@ -144,7 +178,11 @@ def extract(
144
178
)
145
179
146
180
ifnotspan_context.is_valid:
147
-
returncontext
181
+
_logger.error("Invalid Span Extracted. Insertting INVALID span into provided context.")
182
+
returntrace.set_span_in_context(
183
+
trace.INVALID_SPAN,
184
+
context=context
185
+
)
148
186
149
187
returntrace.set_span_in_context(
150
188
trace.DefaultSpan(
@@ -159,12 +197,9 @@ def inject(
159
197
carrier: TextMapPropagatorT,
160
198
context: typing.Optional[Context] =None,
161
199
) ->None:
162
-
ifnotcarrier:
163
-
raiseValueError(("Could not extract from carrier: %s", carrier))
0 commit comments