Skip to content

Commit

Permalink
fix: smll change for manual spans
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Sep 9, 2024
1 parent 797895c commit 8ce4f33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/subscriber/callbacks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
6 changes: 3 additions & 3 deletions src/subscriber/trace_subscriber.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ce4f33

Please sign in to comment.