Struct prometheus::Registry
[−]
[src]
pub struct Registry { /* fields omitted */ }
Registry
registers Prometheus collectors, collects their metrics, and gathers
them into MetricFamilies
for exposition.
Methods
impl Registry
[src]
fn new() -> Registry
[src]
new
creates a Registry.
fn register(&self, c: Box<Collector>) -> Result<()>
[src]
register
registers a new Collector to be included in metrics
collection. It returns an error if the descriptors provided by the
Collector are invalid or if they — in combination with descriptors of
already registered Collectors — do not fulfill the consistency and
uniqueness criteria described in the documentation of Desc
.
If the provided Collector is equal to a Collector already registered (which includes the case of re-registering the same Collector), the AlreadyReg error returns.
fn unregister(&self, c: Box<Collector>) -> Result<()>
[src]
unregister
unregisters the Collector that equals the Collector passed
in as an argument. (Two Collectors are considered equal if their
Describe method yields the same set of descriptors.) The function
returns error when the Collector is not registered.
fn gather(&self) -> Vec<MetricFamily>
[src]
gather
calls the Collect method of the registered Collectors and then
gathers the collected metrics into a lexicographically sorted slice
of MetricFamily protobufs.
Trait Implementations
impl Clone for Registry
[src]
fn clone(&self) -> Registry
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more