package prom

  1. Overview
  2. Docs
Types and pretty printer for Prometheus text-based exposition format

Install

Dune Dependency

Authors

Maintainers

Sources

prom-0.2.tbz
sha256=c322e9a628ecd817509d4d92e0567f51b7deba9a83324188e48b088528e193c1
sha512=75f1228ec70ae7fda5ca1c54f8676b28a06665c97a672a4d74e1b5bcedc1a76626384553ef654bccfc2c8fdc2e19db0d67a9112088e8475660d77e06a528ff4f

doc/prom/Prom/index.html

Module PromSource

Sourcemodule SMap : Containers.Map.S with type key := string
Sourcemodule FSet : Containers.Set.S with type elt := float
Sourcemodule FMap : Containers.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 : Containers.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.