# Packages
Package graphite provides a bridge to push Prometheus metrics to a Graphite server.
Package promauto provides alternative constructors for the fundamental Prometheus metric types and their …Vec and …Func variants.
Package promhttp provides tooling around HTTP servers and clients.
Package push provides functions to push metrics to a Pushgateway.
Package testutil provides helpers to test code using the prometheus package of client_golang.
# Functions
BuildFQName joins the given three name components by "_".
DescribeByCollect is a helper to implement the Describe method of a custom Collector.
ExponentialBuckets creates 'count' buckets, where the lowest bucket has an upper bound of 'start' and each following bucket's upper bound is 'factor' times the previous bucket's upper bound.
LinearBuckets creates 'count' buckets, each 'width' wide, where the lowest bucket has an upper bound of 'start'.
MustNewConstHistogram is a version of NewConstHistogram that panics where NewConstMetric would have returned an error.
MustNewConstMetric is a version of NewConstMetric that panics where NewConstMetric would have returned an error.
MustNewConstSummary is a version of NewConstSummary that panics where NewConstMetric would have returned an error.
MustRegister registers the provided Collectors with the DefaultRegisterer and panics if any error occurs.
NewBuildInfoCollector returns a collector collecting a single metric "go_build_info" with the constant value 1 and three labels "path", "version", and "checksum".
NewConstHistogram returns a metric representing a Prometheus histogram with fixed values for the count, sum, and bucket counts.
NewConstMetric returns a metric with one fixed value that cannot be changed.
NewConstSummary returns a metric representing a Prometheus summary with fixed values for the count, sum, and quantiles.
NewCounter creates a new Counter based on the provided CounterOpts.
NewCounterFunc creates a new CounterFunc based on the provided CounterOpts.
NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.
NewDesc allocates and initializes a new Desc.
NewExpvarCollector returns a newly allocated expvar Collector that still has to be registered with a Prometheus registry.
NewGauge creates a new Gauge based on the provided GaugeOpts.
NewGaugeFunc creates a new GaugeFunc based on the provided GaugeOpts.
NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.
NewGaugeVecReset same as NewGaugeVec, except that it will reset metrics after each scrape.
NewGoCollector returns a collector that exports metrics about the current Go process.
NewHistogram creates a new Histogram based on the provided HistogramOpts.
NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.
NewInvalidDesc returns an invalid descriptor, i.e.
NewInvalidMetric returns a metric whose Write method always returns the provided error.
NewMetricWithTimestamp returns a new Metric wrapping the provided Metric in a way that it has an explicit timestamp set to the provided Time.
NewPedanticRegistry returns a registry that checks during collection if each collected Metric is consistent with its reported Desc, and if the Desc has actually been registered with the registry.
NewProcessCollector returns a collector which exports the current state of process metrics including CPU, memory and file descriptor usage as well as the process start time.
NewRegistry creates a new vanilla Registry without any Collectors pre-registered.
NewSummary creates a new Summary based on the provided SummaryOpts.
NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.
NewTimer creates a new Timer.
NewUntypedFunc creates a new UntypedFunc based on the provided UntypedOpts.
Register registers the provided Collector with the DefaultRegisterer.
Unregister removes the registration of the provided Collector from the DefaultRegisterer.
WrapRegistererWith returns a Registerer wrapping the provided Registerer.
WrapRegistererWithPrefix returns a Registerer wrapping the provided Registerer.
WriteToTextfile calls Gather on the provided Gatherer, encodes the result in the Prometheus text format, and writes it to a temporary file.
# Constants
Possible values for the ValueType enum.
DefAgeBuckets is the default number of buckets used to calculate the age of observations.
DefBufCap is the standard buffer size for collecting Summary observations.
DefMaxAge is the default duration for which observations stay relevant.
ExemplarMaxRunes is the max total number of runes allowed in exemplar labels.
Possible values for the ValueType enum.
Possible values for the ValueType enum.
# Variables
DefaultRegisterer and DefaultGatherer are the implementations of the Registerer and Gatherer interface a number of convenience functions in this package act on.
DefaultRegisterer and DefaultGatherer are the implementations of the Registerer and Gatherer interface a number of convenience functions in this package act on.
DefBuckets are the default Histogram buckets.
# Structs
AlreadyRegisteredError is returned by the Register method if the Collector to be registered has already been registered before, or a different Collector that collects the same metrics has been registered before.
CounterVec is a Collector that bundles a set of Counters that all share the same Desc, but have different values for their variable labels.
Desc is the descriptor used by every Prometheus Metric.
GaugeVec is a Collector that bundles a set of Gauges that all share the same Desc, but have different values for their variable labels.
HistogramOpts bundles the options for creating a Histogram metric.
HistogramVec is a Collector that bundles a set of Histograms that all share the same Desc, but have different values for their variable labels.
Opts bundles the options for creating most Metric types.
ProcessCollectorOpts defines the behavior of a process metrics collector created with NewProcessCollector.
Registry registers Prometheus collectors, collects their metrics, and gathers them into MetricFamilies for exposition.
SummaryOpts bundles the options for creating a Summary metric.
SummaryVec is a Collector that bundles a set of Summaries that all share the same Desc, but have different values for their variable labels.
Timer is a helper type to time functions.
# Interfaces
Collector is the interface implemented by anything that can be used by Prometheus to collect metrics.
Counter is a Metric that represents a single numerical value that only ever goes up.
CounterFunc is a Counter whose value is determined at collect time by calling a provided function.
ExemplarAdder is implemented by Counters that offer the option of adding a value to the Counter together with an exemplar.
ExemplarObserver is implemented by Observers that offer the option of observing a value together with an exemplar.
Gatherer is the interface for the part of a registry in charge of gathering the collected metrics into a number of MetricFamilies.
Gauge is a Metric that represents a single numerical value that can arbitrarily go up and down.
GaugeFunc is a Gauge whose value is determined at collect time by calling a provided function.
A Histogram counts individual observations from an event or sample stream in configurable buckets.
A Metric models a single sample value with its meta data being exported to Prometheus.
Observer is the interface that wraps the Observe method, which is used by Histogram and Summary to add observations.
ObserverVec is an interface implemented by `HistogramVec` and `SummaryVec`.
Registerer is the interface for the part of a registry in charge of registering and unregistering.
A Summary captures individual observations from an event or sample stream and summarizes them in a manner similar to traditional summary statistics: 1.
UntypedFunc works like GaugeFunc but the collected metric is of type "Untyped".
# Type aliases
CounterOpts is an alias for Opts.
GathererFunc turns a function into a Gatherer.
Gatherers is a slice of Gatherer instances that implements the Gatherer interface itself.
GaugeOpts is an alias for Opts.
Labels represents a collection of label name -> value mappings.
MultiError is a slice of errors implementing the error interface.
The ObserverFunc type is an adapter to allow the use of ordinary functions as Observers.
UntypedOpts is an alias for Opts.
ValueType is an enumeration of metric types that represent a simple value.