Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Aug 5, 2020
1 parent d754b58 commit 22eb3dc
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def extract(
span_id = generate_span_id()
sampled = "0"

else:
trace_id = int(trace_id, 16)
span_id = int(span_id, 16)

options = 0
# The b3 spec provides no defined behavior for both sample and
# flag values set. Since the setting of at least one implies
Expand All @@ -115,12 +119,6 @@ def extract(
if sampled in self._SAMPLE_PROPAGATE_VALUES or flags == "1":
options |= trace.TraceFlags.SAMPLED

if isinstance(trace_id, str):
trace_id = int(trace_id, 16)

if isinstance(span_id, str):
span_id = int(span_id, 16)

return trace.set_span_in_context(
trace.DefaultSpan(
trace.SpanContext(
Expand Down

0 comments on commit 22eb3dc

Please sign in to comment.