package trace

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Signature for a collector.

This is only relevant to implementors of tracing backends; to instrument your code you only need to look at the Trace module.

val with_span : __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> data: (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> string -> (int64 -> 'a) -> 'a

Run the function in a new span.

This replaces the previous enter_span and exit_span which were too flexible to be efficient to implement in async contexts.

  • since 0.3
val enter_span : __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> data: (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> string -> int64

Enter a new implicit span. For many uses cases, with_span will be easier to use.

  • since NEXT_RELEASE
val exit_span : int64 -> unit

Exit span. This should be called on the same thread as the corresponding enter_span, and nest properly with other calls to enter/exit_span and with_span.

  • since NEXT_RELEASE
val enter_manual_span : parent:Trace_core__.Types.explicit_span option -> flavor:[ `Sync | `Async ] option -> __FUNCTION__:string option -> __FILE__:string -> __LINE__:int -> data: (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> string -> Trace_core__.Types.explicit_span

Enter an explicit span. Surrounding scope, if any, is provided by parent, and this function can store as much metadata as it wants in the hmap in the explicit_span's meta field.

This means that the collector doesn't need to implement contextual storage mapping span to scopes, metadata, etc. on its side; everything can be transmitted in the explicit_span.

  • since 0.3
val exit_manual_span : Trace_core__.Types.explicit_span -> unit

Exit an explicit span.

  • since 0.3
val add_data_to_span : int64 -> (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> unit
  • since Adds data to the current span.

0.4

val add_data_to_manual_span : Trace_core__.Types.explicit_span -> (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> unit

Adds data to the given span.

  • since 0.4
val message : ?span:int64 -> data: (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> string -> unit

Emit a message with associated metadata.

val name_thread : string -> unit

Give a name to the current thread.

val name_process : string -> unit

Give a name to the current process.

val counter_int : data: (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> string -> int -> unit

Integer counter.

val counter_float : data: (string * [ `Int of int | `String of string | `Bool of bool | `Float of float | `None ]) list -> string -> float -> unit

Float counter.

val shutdown : unit -> unit

Shutdown collector, possibly waiting for it to finish sending data.

OCaml

Innovation. Community. Security.