Trace_subscriber.CallbacksCallbacks used for subscribers.
Each subscriber defines a set of callbacks, for each possible tracing event. These callbacks take a custom state that is paired with the callbacks in Subscriber.t.
To use a default implementation for some callbacks, use:
module My_callbacks = struct
type st = …
include Trace_subscriber.Callbacks.Dummy
let on_init (state:st) ~time_ns : unit = …
(* … other custom callbacks … *)
endNOTE: the trace_id passed alongside manual spans is guaranteed to be at least 64 bits.
module type S = sig ... endFirst class module signature for callbacks
Callbacks for a subscriber. There is one callback per event in Trace. The type 'st is the state that is passed to every single callback.
module Dummy : sig ... endDummy callbacks. It can be useful to reuse some of these functions in a real subscriber that doesn't want to handle all events, but only some of them.
val dummy : unit -> 'st tDummy callbacks, ignores all events.