fix: always enter new scope in opentelemetry-trace

thanks to @ELLIOTTCABLE for finding this
This commit is contained in:
Simon Cruanes 2023-07-25 16:54:36 -04:00
parent a4ead618c5
commit 83b9837778
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -61,9 +61,7 @@ let collector () : Trace.collector =
in in
let new_scope = let new_scope =
match old_scope with { Otel.Scope.span_id; trace_id; events = []; attrs = [] }
| None -> { Otel.Scope.span_id; trace_id; events = []; attrs = [] }
| Some sc -> sc
in in
TLS.set Otel.Scope._global_scope new_scope; TLS.set Otel.Scope._global_scope new_scope;