package
0.8.0
Repository: https://github.com/jacksontj/client_golang.git
Documentation: pkg.go.dev

# README

See go-doc.

# Packages

Package promhttp contains functions to create http.Handler instances to expose Prometheus metrics via HTTP.
Package push provides functions to push metrics to a Pushgateway.

# Functions

BuildFQName joins the given three name components by "_".
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.
Handler returns an HTTP handler for the DefaultGatherer.
InstrumentHandler wraps the given HTTP handler for instrumentation.
InstrumentHandlerFunc wraps the given function for instrumentation.
InstrumentHandlerFuncWithOpts works like InstrumentHandlerFunc (and shares the same issues) but provides more flexibility (at the cost of a more complex call syntax).
InstrumentHandlerWithOpts works like InstrumentHandler (and shares the same issues) but provides more flexibility (at the cost of a more complex call syntax).
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.
MustRegisterOrGet behaves like RegisterOrGet but panics instead of returning an error.
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.
NewGoCollector returns a collector which 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.
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 for the given process id under the given namespace.
NewProcessCollectorPIDFn 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 under the given namespace.
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.
NewUntyped creates a new Untyped metric from the provided UntypedOpts.
NewUntypedFunc creates a new UntypedFunc based on the provided UntypedOpts.
NewUntypedVec creates a new UntypedVec based on the provided UntypedOpts and partitioned by the given label names.
Register registers the provided Collector with the DefaultRegisterer.
RegisterOrGet registers the provided Collector with the DefaultRegisterer and returns the Collector, unless an equal Collector was registered before, in which case that Collector is returned.
SetMetricFamilyInjectionHook replaces the DefaultGatherer with one that gathers from the previous DefaultGatherers but then merges the MetricFamily protobufs returned from the provided hook function with the MetricFamily protobufs returned from the original DefaultGatherer.
UninstrumentedHandler returns an HTTP handler for the DefaultGatherer.
Unregister removes the registration of the provided Collector from the DefaultRegisterer.

# 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.
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.
DefObjectives are the default Summary quantile values.

# 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.
MetricVec is a Collector to bundle metrics of the same name that differ in their label values.
Opts bundles the options for creating most Metric types.
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.
UntypedVec is a Collector that bundles a set of Untyped metrics that all share the same Desc, but have different values for their variable labels.

# 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.
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.
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.
Untyped is a Metric that represents a single numerical value that can arbitrarily go up and down.
UntypedFunc is an Untyped whose value is determined at collect time by calling a provided function.

# 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.
LabelPairSorter implements sort.Interface.
Labels represents a collection of label name -> value mappings.
MultiError is a slice of errors implementing the error interface.
UntypedOpts is an alias for Opts.
ValueType is an enumeration of metric types that represent a simple value.