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:
Simon Cruanes 2026-01-15 17:19:49 -05:00
parent 0bd8868172
commit 66816040aa
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -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;