Skip to main content

Module prometheus

Module prometheus 

Source
Expand description

Prometheus metric exporter (feature prometheus).

PrometheusObserver registers the twenty DialCache collectors on a [Registry] under the names, help text, label sets and histogram buckets of the TypeScript adapter, and feeds every Event to them.

§Sharing one registry

One observer owns one set of collectors. Instances that export to the same registry share the observer: it is Clone, and every clone feeds the same series. The prometheus crate reports a duplicate registration without a handle to the existing collector, so a second new for the same registry and prefix is a PrometheusError::Conflict, as is an externally registered collector under one of the DialCache names. A failed constructor unregisters every collector it had registered, so no series is left behind; the prometheus crate nevertheless remembers each such name with the DialCache schema for the registry’s lifetime, so only a collector with the same schema can take that name later.

Structs§

CollectorSchema
The wire schema of one collector: what a scrape exposes.
PrometheusObserver
Publishes DialCache diagnostics to Prometheus collectors.

Enums§

PrometheusError
Construction failures of a PrometheusObserver.

Functions§

schemas
The twenty collectors DialCache registers, in registration order, with their names under prefix.