Module type Callbacks.S

First class module signature for callbacks

type st

Type of the state passed to every callback.

val on_init : st -> time_ns:float -> unit

Called when the subscriber is initialized in a collector

val on_shutdown : st -> time_ns:float -> unit

Called when the collector is shutdown

val on_name_thread : st -> time_ns:float -> tid:int -> name:string -> unit

Current thread is being named

val on_name_process : st -> time_ns:float -> tid:int -> name:string -> unit

Current process is being named

val on_enter_span : st -> __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> time_ns:float -> tid:int -> data:(string * Trace_subscriber__.Types.user_data) list -> name:string -> Trace_core.span -> unit

Enter a regular (sync) span

val on_exit_span : st -> time_ns:float -> tid:int -> Trace_core.span -> unit

Exit a span. This and on_enter_span must follow strict stack discipline

val on_add_data : st -> data:(string * Trace_subscriber__.Types.user_data) list -> Trace_core.span -> unit

Add data to a regular span (which must be active)

val on_message : st -> time_ns:float -> tid:int -> span:Trace_core.span option -> data:(string * Trace_subscriber__.Types.user_data) list -> string -> unit

Emit a log message

val on_counter : st -> time_ns:float -> tid:int -> data:(string * Trace_subscriber__.Types.user_data) list -> name:string -> float -> unit

Emit the current value of a counter

val on_enter_manual_span : st -> __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> time_ns:float -> tid:int -> parent:Trace_core.span option -> data:(string * Trace_subscriber__.Types.user_data) list -> name:string -> flavor:Trace_subscriber__.Types.flavor option -> trace_id:int -> Trace_core.span -> unit

Enter a manual (possibly async) span

val on_exit_manual_span : st -> time_ns:float -> tid:int -> name:string -> data:(string * Trace_subscriber__.Types.user_data) list -> flavor:Trace_subscriber__.Types.flavor option -> trace_id:int -> Trace_core.span -> unit

Exit a manual span