A struct for registering Prometheus collectors, collecting their metrics, and gathering
MetricFamilies for exposition.
new creates a Registry.
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
unregister unregisters the
Collector that equals the
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.
gather calls the Collect method of the registered Collectors and then
gathers the collected metrics into a lexicographically sorted slice
of MetricFamily protobufs.
Performs copy-assignment from
source. Read more
The type returned in the event of a conversion error.