We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fc6911 commit 85e0d57Copy full SHA for 85e0d57
sentry_sdk/tracing.py
@@ -142,7 +142,7 @@ def __init__(
142
self.trace_id = trace_id or uuid.uuid4().hex
143
144
if not span_id and _span_id_generator:
145
- span_id = next(_span_id_generator)
+ span_id = "{:016x}".format(int(self.trace_id, 16) + next(_span_id_generator))
146
147
if not span_id:
148
span_id = uuid.uuid4().hex[16:]
@@ -460,7 +460,7 @@ def __init__(
460
# next() on itertools.count() is a way to get-and-increment an integer
461
# "atomically" on Python runtimes with a GIL
462
if _ITERTOOLS_COUNT_IS_ATOMIC and kwargs.pop("_fast_span_ids", None):
463
- kwargs['_span_id_generator'] = ("{:016x}".format(i) for i in itertools.count())
+ kwargs['_span_id_generator'] = itertools.count()
464
465
Span.__init__(self, **kwargs)
466
self.name = name
0 commit comments