Module Opentelemetry.Collector

include module type of struct include Exporter end
include module type of struct include Opentelemetry_core.Exporter end
type t = Opentelemetry_core.Exporter.t = {
  1. export : Opentelemetry_core.Any_signal_l.t -> unit;
    (*

    Export a batch of signals. Called by the provider when signals are ready to be sent.

    *)
  2. active : unit -> Opentelemetry_util.Aswitch.t;
    (*

    Lifecycle switch: turns off when the exporter has fully shut down (i.e. the consumer queue is drained).

    *)
  3. shutdown : unit -> unit;
    (*

    shutdown () initiates shutdown: flushes remaining batches, closes the queue, etc. Watch active to know when it's complete.

    • since 0.12
    *)
  4. self_metrics : unit -> Opentelemetry_core.Metrics.t list;
    (*

    metrics about the exporter itself

    *)
}

Main exporter interface.

val dummy : unit -> t

Dummy exporter, does nothing

val shutdown : t -> unit
val cleanup : t -> unit
include module type of struct include Sdk end
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