Module Opentelemetry.Sdk

include module type of struct include Sdk end
val remove : on_done:(unit -> unit) -> unit -> unit

Remove current exporter, if any.

  • parameter on_done

    called once the exporter has fully shut down (queue drained).

val present : unit -> bool
val get : unit -> Opentelemetry_core.Exporter.t option
val active : unit -> Opentelemetry_util.Aswitch.t

Aswitch of the installed exporter, or Aswitch.dummy if none.

val add_on_tick_callback : (unit -> unit) -> unit
val run_tick_callbacks : unit -> unit
val tick : unit -> unit

Tick all providers and run all registered callbacks. Call this periodically (e.g. every 500ms) to drive metrics collection, GC metrics, and batch timeout flushing. This is the single function client libraries should call from their ticker.

val self_metrics : unit -> Opentelemetry_core.Metrics.t list
val setup_self_metrics : unit -> unit

Regularly emit metrics about the OTEL SDK. Idempotent.

val get_tracer : ?name:string -> ?version:string -> ?attrs:(string * [< Opentelemetry_core.Value.t ]) list -> ?__MODULE__:string -> unit -> Tracer.t

Get a tracer forwarding to the current main exporter.

  • since 0.90
val get_meter : ?name:string -> ?version:string -> ?attrs:(string * [< Opentelemetry_core.Value.t ]) list -> ?__MODULE__:string -> unit -> Meter.t

Get a meter forwarding to the current main exporter.

  • since 0.90
val get_logger : ?name:string -> ?version:string -> ?attrs:(string * [< Opentelemetry_core.Value.t ]) list -> ?__MODULE__:string -> unit -> Logger.t

Get a logger forwarding to the current main exporter.

  • since 0.90
val self_debug_to_stderr : ?min_level:Self_debug.level -> unit -> unit