fix: smll change for manual spans

This commit is contained in:
Simon Cruanes 2024-09-09 15:33:09 -04:00
parent 797895c193
commit 8ce4f332c6
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 4 additions and 4 deletions

View file

@ -61,7 +61,7 @@ module type S = sig
__LINE__:int ->
time_ns:float ->
tid:int ->
parent:explicit_span option ->
parent:span option ->
data:(string * user_data) list ->
name:string ->
flavor:[ `Sync | `Async ] option ->

View file

@ -84,10 +84,10 @@ let collector (Sub { st; callbacks = (module CB) } : Subscriber.t) : collector =
let time_ns = now_ns () in
(* get the common trace id, or make a new one *)
let trace_id =
let trace_id, parent =
match parent with
| Some m -> Meta_map.find_exn key_async_trace_id m.meta
| None -> A.fetch_and_add trace_id_gen_ 1
| Some m -> Meta_map.find_exn key_async_trace_id m.meta, Some m.span
| None -> A.fetch_and_add trace_id_gen_ 1, None
in
CB.on_enter_manual_span st ~__FUNCTION__ ~__FILE__ ~__LINE__ ~parent ~data