package opentelemetry

  1. Overview
  2. Docs

Module Opentelemetry.CollectorSource

Collector types

These types are used by backend implementations, to send events to collectors such as Jaeger.

Note: most users will not need to touch this module

Sourcetype 'msg sender = {
  1. send : 'a. 'msg -> ret:(unit -> 'a) -> 'a;
}

Sender interface for a message of type msg. Inspired from Logs' reporter (see its doc) but without over as it doesn't make much sense in presence of batching.

The ret callback is used to return the desired type (unit, or a Lwt promise, or anything else) once the event has been transferred to the backend. It doesn't mean the event has been collected yet, it could sit in a batch queue for a little while.

Sourcemodule type BACKEND = sig ... end

Collector client interface.

Sourcetype backend = (module BACKEND)
Sourceval debug_backend : backend
Sourceval set_backend : backend -> unit

Set collector backend

Sourceval remove_backend : unit -> unit

Remove current backend, if any.

  • since NEXT_RELEASE
Sourceval has_backend : unit -> bool

Is there a configured backend?

Sourceval get_backend : unit -> backend option

Current backend, if any

Sourceval send_trace : Opentelemetry_proto.Trace.resource_spans list -> ret:(unit -> 'a) -> 'a
Sourceval send_metrics : Opentelemetry_proto.Metrics.resource_metrics list -> ret:(unit -> 'a) -> 'a
Sourceval send_logs : Opentelemetry_proto.Logs.resource_logs list -> ret:(unit -> 'a) -> 'a
Sourceval rand_bytes_16 : unit -> bytes
Sourceval rand_bytes_8 : unit -> bytes
Sourceval on_tick : (unit -> unit) -> unit
Sourceval tick : unit -> unit

Do background work. Call this regularly if the collector doesn't already have a ticker thread or internal timer.

Sourceval with_setup_debug_backend : backend -> ?enable:bool -> unit -> (unit -> 'a) -> 'a
OCaml

Innovation. Community. Security.