package prom

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module PromSource

Sourcemodule SMap : Map.S with type key := string
Sourcemodule FSet : Set.S with type elt := float
Sourcemodule FMap : Map.S with type key := float
Sourcemodule KLL : sig ... end
Sourcetype 'a complex = {
  1. count : int;
  2. sum : float;
  3. data : 'a;
}
Sourcetype histogram = int FMap.t complex
Sourcetype summary = (KLL.t * FSet.t) complex
Sourceval cumulate : int FMap.t -> int FMap.t

cumulate hist is the cumulative histogram of hist, suitable to ingestion by Prometheus.

Sourceval complex_cum_fmap : int -> float -> int FMap.t -> histogram

complex_cum count sum data is a complex value constructed from count, sum and data where data is a cumulated histogram or CDF.

Sourceval complex_cum : int -> float -> (float * int) list -> histogram

complex_cum count sum data is a complex value constructed from count, sum and data where data is a cumulated histogram or CDF.

Sourceval complex : int -> float -> (float * int) list -> histogram

complex count sum data is a complex value constructed from count, sum and data where data is a non-cumulated histogram.

Sourcemodule LabelsMap : Map.S with type key := string SMap.t

A kv map (label) uniquely identifying a time series.

Sourcetype 'a metric = 'a series LabelsMap.t

Type of a metric. A metric associates a time series to a set of labels.

Sourceand 'a series = {
  1. ts : Ptime.t option;
  2. v : 'a;
}

Type of a time series. Contains an optional timestamp.

Sourceval create_series : ?ts:Ptime.t -> 'a -> 'a series
Sourcetype t

Type of a Prometheus metric. Contains a name, an optional help text, a type, and labels associated to a value.

Sourceval add_labels : (string * string) list -> t -> t

add_labels labels t will add labels to all series in t.

Sourceval merge : t -> t -> t
Sourceval pp : t Fmt.t
Sourceval pp_list : t list Fmt.t
Sourceval counter : ?help:string -> string -> ((string * string) list * float series) list -> t
Sourceval gauge : ?help:string -> string -> ((string * string) list * float series) list -> t
Sourceval histogram : ?help:string -> string -> ((string * string) list * histogram series) list -> t
Sourceval summary : ?help:string -> string -> ((string * string) list * summary series) list -> t
OCaml

Innovation. Community. Security.