Crate prometheus [−] [src]
The Rust client library for Prometheus.
Modules
local |
Unsync local metrics, provides better performance. |
proto |
Protocol buffers format of metrics. |
Macros
histogram_opts |
Creates a |
labels |
Creates labels with specified name-value pairs. |
opts |
Creates an |
register_counter |
Creates a |
register_counter_vec |
Creates a |
register_gauge |
Creates a |
register_gauge_vec |
Creates a |
register_histogram |
Creates a |
register_histogram_vec |
Creates a |
register_int_counter |
Creates an |
register_int_counter_vec |
Creates an |
register_int_gauge |
Creates an |
register_int_gauge_vec |
Creates an |
Structs
Desc |
The descriptor used by every Prometheus Metric. It is essentially
the immutable meta-data of a metric. The normal metric implementations
included in this package manage their |
Histogram |
A Metric 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 |
A struct that 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. |
HistogramTimer |
A struct represents an event being timed. When the timer goes out of
scope, the duration will be observed, or call |
MetricVec |
A Collector to bundle metrics of the same name that
differ in their label values. |
Opts |
A struct that bundles the options for creating most Metric types. |
ProtobufEncoder |
An implementation of an |
Registry |
A struct for registering Prometheus collectors, collecting their metrics, and gathering
them into |
TextEncoder |
An implementation of an |
Enums
Error |
The error types for prometheus. |
Constants
DEFAULT_BUCKETS |
The default Histogram buckets. The default buckets are tailored to broadly measure the response time (in seconds) of a network service. Most likely, however, you will be required to define buckets customized to your use case. |
PROTOBUF_FORMAT |
The protocol buffer format of metric family. |
TEXT_FORMAT |
The text format of metric family. |
Traits
Collector |
An interface for collecting metrics. |
Encoder |
An interface for encoding metric families into an underlying wire protocol. |
Functions
exponential_buckets |
Creates |
gather |
Returns all |
linear_buckets |
Creates |
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 |
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
Counter |
A Metric represents a single numerical value that only ever goes up. |
CounterVec |
A Collector that bundles a set of |
Gauge |
A Metric represents a single numerical value that can arbitrarily go up and down. |
GaugeVec |
A Collector that bundles a set of |
HistogramVec |
A Collector that bundles a set of Histograms 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. HTTP request latencies, partitioned by status code and method). |
IntCounter |
The integer version of |
IntCounterVec |
The integer version of |
IntGauge |
The integer version of |
IntGaugeVec |
The integer version of |
Result |
A specialized Result type for prometheus. |