File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ def __init__(
142
142
self .trace_id = trace_id or uuid .uuid4 ().hex
143
143
144
144
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 ) )
146
146
147
147
if not span_id :
148
148
span_id = uuid .uuid4 ().hex [16 :]
@@ -460,7 +460,7 @@ def __init__(
460
460
# next() on itertools.count() is a way to get-and-increment an integer
461
461
# "atomically" on Python runtimes with a GIL
462
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 () )
463
+ kwargs ['_span_id_generator' ] = itertools .count ()
464
464
465
465
Span .__init__ (self , ** kwargs )
466
466
self .name = name
You can’t perform that action at this time.
0 commit comments