Skip to content

Commit 85e0d57

Browse files
committed
wups
1 parent 7fc6911 commit 85e0d57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/tracing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def __init__(
142142
self.trace_id = trace_id or uuid.uuid4().hex
143143

144144
if not span_id and _span_id_generator:
145-
span_id = next(_span_id_generator)
145+
span_id = "{:016x}".format(int(self.trace_id, 16) + next(_span_id_generator))
146146

147147
if not span_id:
148148
span_id = uuid.uuid4().hex[16:]
@@ -460,7 +460,7 @@ def __init__(
460460
# next() on itertools.count() is a way to get-and-increment an integer
461461
# "atomically" on Python runtimes with a GIL
462462
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())
463+
kwargs['_span_id_generator'] = itertools.count()
464464

465465
Span.__init__(self, **kwargs)
466466
self.name = name

0 commit comments

Comments
 (0)