Crate prometheus [] [src]

Modules

encoder
errors
proto

Macros

histogram_opts
labels
opts
register_counter
register_gauge
register_histogram

Structs

Counter

Counter is a Metric that represents a single numerical value that only ever goes up.

Desc
Gauge

Gauge is a Metric that represents a single numerical value that can arbitrarily go up and down.

Histogram

A Histogram counts individual observations from an event or sample stream in configurable buckets. Similar to a summary, it also provides a sum of observations and an observation count.

HistogramOpts

HistogramOpts bundles the options for creating a Histogram metric. It is mandatory to set Name and Help to a non-empty string. All other fields are optional and can safely be left at their zero value.

Opts

Opts bundles the options for creating most Metric types.

Registry

Registry registers Prometheus collectors, collects their metrics, and gathers them into MetricFamilies for exposition.

Constants

BUCKET_LABEL
DEFAULT_BUCKETS

Traits

Collector

Collector is the trait that can be used to collect metrics. A Collector has to be registered for collection.

Functions

exponential_buckets

exponential_buckets creates count buckets, where the lowest bucket has an upper bound of start and each following buckets upper bound isfactortimes the previous buckets upper bound. The final +Inf bucket is not counted and not included in the returned slice. The returned slice is meant to be used for the Buckets field of HistogramOpts.

gather

gather returns all MetricFamily of DEFAULT_REGISTRY.

linear_buckets

linear_buckets creates count buckets, each width wide, where the lowest bucket has an upper bound of start. The final +Inf bucket is not counted and not included in the returned slice. The returned slice is meant to be used for the Buckets field of HistogramOpts.

register

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 Desc documentation.

unregister

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 an error if a Collector was not registered.

Type Definitions

CounterVec

CounterVec is a Collector that bundles a set of Counters that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. number of HTTP requests, partitioned by response code and method).

GaugeVec

GaugeVec is a Collector that bundles a set of Gauges that all share the same Desc, but have different values for their variable labels. This is used if you want to count the same thing partitioned by various dimensions (e.g. number of operations queued, partitioned by user and operation type).

HistogramVec