We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b944656 commit ad1cde3Copy full SHA for ad1cde3
sentry_sdk/tracing_utils.py
@@ -53,7 +53,7 @@
53
"[0-9]{2}?" # version
54
"-?([0-9a-f]{32})?" # trace_id
55
"-?([0-9a-f]{16})?" # span_id
56
- "-?([01]{2})?" # trace-flags
+ "-?([0-9]{2})?" # trace-flags
57
"[ \t]*$" # whitespace
58
)
59
@@ -369,7 +369,8 @@ def extract_w3c_traceparent_data(header):
369
if parent_span_id:
370
parent_span_id = "{:016x}".format(int(parent_span_id, 16))
371
if trace_flags:
372
- parent_sampled = trace_flags == "01"
+ trace_flags_byte = int(trace_flags, 16)
373
+ parent_sampled = (trace_flags_byte & 0x01) == 1
374
375
return {
376
"trace_id": trace_id,
0 commit comments