package opentelemetry

  1. Overview
  2. Docs
Core library for instrumentation and serialization for https://opentelemetry.io

Install

dune-project
 Dependency

Authors

Maintainers

Sources

opentelemetry-0.91.tbz
sha256=4aaee2025957acf71434a027bd57ee699a9ae927e6b49804fb1e999e16a03694
sha512=f3ec030fc4ca0483c3fc143eaa802e2aa02b4c25e1a03ec967bd017fad8a4ef6287e9f9688486434d1ac2fc403217658b61d2c7f3709c092c939b93f412ee5c5

doc/src/opentelemetry.core/exporter.ml.html

Source file exporter.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(** Exporter.

    This is the pluggable component that actually sends signals to a OTEL
    collector, or prints them, or saves them somewhere.

    This is part of the SDK, not just the API, so most real implementations live
    in their own library. *)

type t = {
  export: Any_signal_l.t -> unit;
      (** Export a batch of signals. Called by the provider when signals are
          ready to be sent. *)
  active: unit -> Aswitch.t;
      (** Lifecycle switch: turns off when the exporter has fully shut down
          (i.e. the consumer queue is drained). *)
  shutdown: unit -> unit;
      (** [shutdown ()] initiates shutdown: flushes remaining batches, closes
          the queue, etc. Watch [active] to know when it's complete.
          @since 0.12 *)
  self_metrics: unit -> Metrics.t list;  (** metrics about the exporter itself *)
}
(** Main exporter interface. *)

(** Dummy exporter, does nothing *)
let dummy () : t =
  {
    export = ignore;
    active = (fun () -> Aswitch.dummy);
    shutdown = ignore;
    self_metrics = (fun () -> []);
  }

let[@inline] active (self : t) : Aswitch.t = self.active ()

let[@inline] shutdown (self : t) : unit = self.shutdown ()

let (cleanup [@deprecated "use shutdown instead"]) = shutdown

let[@inline] self_metrics (self : t) : _ list = self.self_metrics ()