# Packages
Package collectors provides implementations of prometheus.Collector to conveniently collect process and Go-related metrics.
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.
ExponentialBucketsRange creates 'count' buckets, where the lowest bucket is 'min' and the highest bucket is 'max'.
LinearBuckets creates 'count' buckets, each 'width' wide, where the lowest bucket has an upper bound of 'start'.
MakeLabelPairs is a helper function to create protobuf LabelPairs from the variable and constant labels in the provided Desc.
MustNewConstHistogram is a version of NewConstHistogram that panics where NewConstHistogram 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.
MustNewMetricWithExemplars is a version of NewMetricWithExemplars that panics where NewMetricWithExemplars would have returned an error.
MustRegister registers the provided Collectors with the DefaultRegisterer and panics if any error occurs.
NewBuildInfoCollector is the obsolete version of collectors.NewBuildInfoCollector.
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 is the obsolete version of collectors.NewExpvarCollector.
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.
NewGoCollector is the obsolete version of collectors.NewGoCollector.
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.
NewMetricVec returns an initialized metricVec.
NewMetricWithExemplars returns a new Metric wrapping the provided Metric with given exemplars.
NewMetricWithTimestamp returns a new Metric wrapping the provided Metric in a way that it has an explicit timestamp set to the provided Time.
NewMultiTRegistry creates MultiTRegistry.
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.
NewPidFileFn returns a function that retrieves a pid from the specified file.
NewProcessCollector is the obsolete version of collectors.NewProcessCollector.
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.
ToTransactionalGatherer transforms Gatherer to transactional one with noop as done function.
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
No description provided by the author
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.
No description provided by the author
No description provided by the author
# 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.
Exemplar is easier to use, user-facing representation of *dto.Exemplar.
GaugeVec is a Collector that bundles a set of Gauges that all share the same Desc, but have different values for their variable labels.
GoCollectorOptions should not be used be directly by anything, except `collectors` package.
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.
MetricVec is a Collector to bundle metrics of the same name that differ in their label values.
MultiTRegistry is a TransactionalGatherer that joins gathered metrics from multiple transactional gatherers.
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.
TransactionalGatherer represents transactional gatherer that can be triggered to notify gatherer that memory used by metric family is no longer used by a caller.
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.