mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
core: remove current_span from collector
probably orthogonal, collectors can provide this optionally via ambient-context if desired. doesn't need to be in the Trace_core collector itself.
This commit is contained in:
parent
0bd8868172
commit
66816040aa
1 changed files with 3 additions and 9 deletions
|
|
@ -28,10 +28,6 @@ module Callbacks = struct
|
||||||
exit_span: 'st -> span -> unit;
|
exit_span: 'st -> span -> unit;
|
||||||
(** Exit a span. Must be called exactly once per span. Additional
|
(** Exit a span. Must be called exactly once per span. Additional
|
||||||
constraints on nesting, threads, etc. vary per collector. *)
|
constraints on nesting, threads, etc. vary per collector. *)
|
||||||
current_span: 'st -> span option;
|
|
||||||
(** Access the current span, if supported. Returns [None] if there is no
|
|
||||||
current span or if the current span isn't tracked by the collector.
|
|
||||||
*)
|
|
||||||
add_data_to_span: 'st -> span -> (string * user_data) list -> unit;
|
add_data_to_span: 'st -> span -> (string * user_data) list -> unit;
|
||||||
message:
|
message:
|
||||||
'st ->
|
'st ->
|
||||||
|
|
@ -66,14 +62,12 @@ module Callbacks = struct
|
||||||
(** Callbacks taking a state ['st] *)
|
(** Callbacks taking a state ['st] *)
|
||||||
|
|
||||||
(** Helper to create backends in a future-proof way *)
|
(** Helper to create backends in a future-proof way *)
|
||||||
let make ~enter_span ~exit_span ?(current_span = fun _ -> None)
|
let make ~enter_span ~exit_span ~add_data_to_span ~message ~counter_int
|
||||||
~add_data_to_span ~message ~counter_int ~counter_float
|
~counter_float ?(extension = fun _ _ -> ()) ?(init = ignore)
|
||||||
?(extension = fun _ _ -> ()) ?(init = ignore) ?(shutdown = ignore) () :
|
?(shutdown = ignore) () : _ t =
|
||||||
_ t =
|
|
||||||
{
|
{
|
||||||
enter_span;
|
enter_span;
|
||||||
exit_span;
|
exit_span;
|
||||||
current_span;
|
|
||||||
add_data_to_span;
|
add_data_to_span;
|
||||||
message;
|
message;
|
||||||
counter_int;
|
counter_int;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue