Prometheus.CollectorRegistryA collection of metric reporters. Usually, only CollectorRegistry.default is used.
type snapshot = Sample_set.t LabelSetMap.t MetricFamilyMap.tThe result of reading a set of metrics.
val create : unit -> tcreate () is a fresh registry. This is mostly useful for testing.
val default : tThe default registry.
val register :
t ->
MetricInfo.t ->
(unit -> Sample_set.t LabelSetMap.t) ->
unitregister 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.
val register_lwt :
t ->
MetricInfo.t ->
(unit -> Sample_set.t LabelSetMap.t Lwt.t) ->
unitregister_lwt t metric collector is the same as register t metrics collector but collector returns Sample_set.t LabelSetMap.t Lwt.t.
val register_pre_collect : t -> (unit -> unit) -> unitregister_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.
val register_pre_collect_lwt : t -> (unit -> unit Lwt.t) -> unitregister_pre_collect t fn same as register_pre_collect but fn returns unit Lwt.t.