Skip to content

Commit

Permalink
fixes: check for dummy spans in some operations
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Mar 8, 2024
1 parent b52f150 commit e76a977
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/trace_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,21 @@ let[@inline] enter_manual_toplevel_span ?flavor ?level ?__FUNCTION__ ~__FILE__
| _ -> Collector.dummy_explicit_span

let[@inline] exit_manual_span espan : unit =
match A.get collector with
| None -> ()
| Some (module C) -> C.exit_manual_span espan
if espan != Collector.dummy_explicit_span then (
match A.get collector with
| None -> ()
| Some (module C) -> C.exit_manual_span espan
)

let[@inline] add_data_to_span sp data : unit =
if data <> [] then (
if sp != Collector.dummy_span && data <> [] then (
match A.get collector with
| None -> ()
| Some (module C) -> C.add_data_to_span sp data
)

let[@inline] add_data_to_manual_span esp data : unit =
if data <> [] then (
if esp != Collector.dummy_explicit_span && data <> [] then (
match A.get collector with
| None -> ()
| Some (module C) -> C.add_data_to_manual_span esp data
Expand Down

0 comments on commit e76a977

Please sign in to comment.