Documentation
¶
Overview ¶
Package prometheus implements a Prometheus backend for package metrics.
Index ¶
- Variables
- func NewCounter(namespace, subsystem, name, help string, fieldKeys []string) metrics.Counter
- func NewCounterWithLabels(namespace, subsystem, name, help string, fieldKeys []string, ...) metrics.Counter
- func NewGauge(namespace, subsystem, name, help string, fieldKeys []string) metrics.Gauge
- func NewGaugeWithLabels(namespace, subsystem, name, help string, fieldKeys []string, ...) metrics.Gauge
- func NewHistogram(namespace, subsystem, name, help string, fieldKeys []string) metrics.Histogram
- func NewHistogramWithLabels(namespace, subsystem, name, help string, fieldKeys []string, ...) metrics.Histogram
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 ¶
NewCounter returns a new Counter backed by a Prometheus metric. The counter is automatically registered via prometheus.Register.
func NewCounterWithLabels ¶
func NewCounterWithLabels(namespace, subsystem, name, help string, fieldKeys []string, constLabels prometheus.Labels) metrics.Counter
NewCounterWithLabels is the same as NewCounter, but attaches a set of const label pairs to the metric.
func NewGauge ¶
NewGauge returns a new Gauge backed by a Prometheus metric. The gauge is automatically registered via prometheus.Register.
func NewGaugeWithLabels ¶
func NewGaugeWithLabels(namespace, subsystem, name, help string, fieldKeys []string, constLabels prometheus.Labels) metrics.Gauge
NewGaugeWithLabels is the same as NewGauge, but attaches a set of const label pairs to the metric.
func NewHistogram ¶
NewHistogram returns a new Histogram backed by a Prometheus summary. It uses a 10-second max age for bucketing. The histogram is automatically registered via prometheus.Register.
func NewHistogramWithLabels ¶
func NewHistogramWithLabels(namespace, subsystem, name, help string, fieldKeys []string, constLabels prometheus.Labels) metrics.Histogram
NewHistogramWithLabels is the same as NewHistogram, but attaches a set of const label pairs to the metric.
Types ¶
This section is empty.