Skip to content

Commit a61125e

Browse files
committed
If no incoming context, use same id for s & t
1 parent 1d36e66 commit a61125e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

instana/tracer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ def start_span(
4040
parent_ctx = references[0].referenced_context
4141

4242
# Assemble the child ctx
43-
ctx = SpanContext(span_id=generate_id())
43+
instana_id = generate_id()
44+
ctx = SpanContext(span_id=instana_id)
4445
if parent_ctx is not None:
4546
if parent_ctx._baggage is not None:
4647
ctx._baggage = parent_ctx._baggage.copy()
4748
ctx.trace_id = parent_ctx.trace_id
4849
ctx.sampled = parent_ctx.sampled
4950
else:
50-
ctx.trace_id = generate_id()
51+
ctx.trace_id = instana_id
5152
ctx.sampled = self.sampler.sampled(ctx.trace_id)
5253

5354
# Tie it all together

0 commit comments

Comments
 (0)