package prometheus

  1. Overview
  2. Docs

Module Prometheus.CollectorRegistrySource

A collection of metric reporters. Usually, only CollectorRegistry.default is used.

Sourcetype t

A collection of metrics to be monitored.

The result of reading a set of metrics.

Sourceval create : unit -> t

create () is a fresh registry. This is mostly useful for testing.

Sourceval default : t

The default registry.

Sourceval collect : t -> snapshot

Read the current value of each metric.

Sourceval register : t -> MetricInfo.t -> (unit -> Sample_set.t LabelSetMap.t) -> unit

register t metric collector adds metric to the set of metrics being collected. It will call collector () to collect the values each time collect is called.

Sourceval register_pre_collect : t -> (unit -> unit) -> unit

register_pre_collect t fn arranges for fn () to be called at the start of each collection. This is useful if one expensive call provides information about multiple metrics.

OCaml

Innovation. Community. Security.