more docs

This commit is contained in:
Simon Cruanes 2025-12-27 22:08:22 -05:00
parent b1589ccf76
commit ae92077389
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
13 changed files with 39 additions and 11 deletions

View file

@ -1,4 +1,4 @@
(** A thread-safe batch of resources, to be sent together when ready . *)
(** A thread-safe batch of resources, to be sent together when ready. *)
type 'a t

View file

@ -1,4 +1,4 @@
(** Consumer that accepts items from a bounded queue *)
(** Consumer that accepts items from a bounded queue and processes them. *)
open Common_

View file

@ -1,4 +1,4 @@
(** Combine multiple emitters into one *)
(** Combine multiple emitters into one. *)
open Opentelemetry_emitter.Emitter

View file

@ -1,3 +1,5 @@
(** Error that can occur during export *)
type t =
[ `Status of int * Opentelemetry.Proto.Status.status
| `Failure of string

View file

@ -1,4 +1,8 @@
(** Add batching to emitters *)
(** Add batching to the emitters of an exporter.
The exporter has multiple emitters (one per signal type), this can add
batching on top of each of them (so that they emit less frequent, larger
batches of signals, amortizing the per-signal cost). *)
open Common_

View file

@ -1,3 +1,5 @@
(** Combine multiple exporters into one *)
open Common_
open Opentelemetry_atomic

View file

@ -1,3 +1,8 @@
(** Basic debug exporter, prints signals on stdout/stderr/...
As the name says, it's not intended for production but as a quick way to
export signals and eyeball them. *)
open Common_
open Opentelemetry_emitter

View file

@ -1,4 +1,11 @@
(** Build an exporter from a queue and a consumer *)
(** Build an exporter from a queue and a consumer.
The exporter will send signals into the queue (possibly dropping them if the
queue is full), and the consumer is responsible for actually exporting the
signals it reads from the other end of the queue.
At shutdown time, the queue is closed for writing, but only once it's empty
will the consumer properly shutdown. *)
open Common_
module BQ = Bounded_queue

View file

@ -1,4 +1,4 @@
(** A simple exporter that prints on stdout *)
(** A simple exporter that prints on stdout. *)
open Common_
open Opentelemetry_emitter

View file

@ -1,4 +1,7 @@
(** Generic IO *)
(** Generic IO monad.
This factors out some logic between various concurrency frameworks. *)
module type S = sig
type 'a t

View file

@ -1,3 +1,5 @@
(** Generic notifier (used to signal when a bounded queue is empty) *)
module type IO = Generic_io.S
module type S = sig

View file

@ -1,4 +1,4 @@
(** Basic random sampling *)
(** Basic random sampling. *)
type t
@ -16,10 +16,12 @@ val accept : t -> bool
val proba_accept : t -> float
val actual_rate : t -> float
(** The ratio of signals we actually accepted so far *)
(** The ratio of signals we actually accepted so far. This should asymptotically
be equal to {!proba_accept} if the random generator is good. *)
open Opentelemetry_emitter
val wrap_emitter : t -> 'a Emitter.t -> 'a Emitter.t
(** [wrap_emitter sampler e] is a new emitter that uses the [sampler] on each
individual signal before passing them to [e]. *)
individual signal before passing them to [e]. This means only [proba_accept]
of the signals will actually be emitted. *)

View file

@ -1,4 +1,5 @@
(** Mini tracing module (disabled if [config.self_trace=false]) *)
(** Mini tracing module for OTEL itself (disabled if [config.self_trace=false])
*)
open Common_