Documentation ¶
Overview ¶
Package prometheus implements a Prometheus backend for package metrics.
Index ¶
- Variables
- func NewCounter(opts prometheus.CounterOpts, fieldKeys []string) metrics.Counter
- func NewGauge(opts prometheus.GaugeOpts, fieldKeys []string) metrics.Gauge
- func NewHistogram(opts prometheus.HistogramOpts, fieldKeys []string) metrics.Histogram
- func NewSummary(opts prometheus.SummaryOpts, fieldKeys []string) metrics.Histogram
- func RegisterCallbackGauge(opts prometheus.GaugeOpts, callback func() float64)
Constants ¶
This section is empty.
Variables ¶
var PrometheusLabelValueUnknown = "unknown"
Prometheus has strong opinions about the dimensionality of fields. Users must predeclare every field key they intend to use. On every observation, fields with keys that haven't been predeclared will be silently dropped, and predeclared field keys without values will receive the value PrometheusLabelValueUnknown.
Functions ¶
func NewCounter ¶
func NewCounter(opts prometheus.CounterOpts, fieldKeys []string) metrics.Counter
NewCounter returns a new Counter backed by a Prometheus metric. The counter is automatically registered via prometheus.Register.
func NewGauge ¶
func NewGauge(opts prometheus.GaugeOpts, fieldKeys []string) metrics.Gauge
NewGauge returns a new Gauge backed by a Prometheus metric. The gauge is automatically registered via prometheus.Register.
func NewHistogram ¶
func NewHistogram(opts prometheus.HistogramOpts, fieldKeys []string) metrics.Histogram
NewHistogram returns a new Histogram backed by a Prometheus Histogram. The histogram is automatically registered via prometheus.Register.
For more information on Prometheus histograms and summaries, refer to http://prometheus.io/docs/practices/histograms.
func NewSummary ¶
func NewSummary(opts prometheus.SummaryOpts, fieldKeys []string) metrics.Histogram
NewSummary returns a new Histogram backed by a Prometheus summary. The histogram is automatically registered via prometheus.Register.
For more information on Prometheus histograms and summaries, refer to http://prometheus.io/docs/practices/histograms.
func RegisterCallbackGauge ¶
func RegisterCallbackGauge(opts prometheus.GaugeOpts, callback func() float64)
RegisterCallbackGauge registers a Gauge with Prometheus whose value is determined at collect time by the passed callback function. The callback determines the value, and fields are ignored, so RegisterCallbackGauge returns nothing.
Types ¶
This section is empty.