package prometheus
import "github.com/go-kit/kit/metrics/prometheus"
Package prometheus provides Prometheus implementations for metrics. Individual metrics are mapped to their Prometheus counterparts, and (depending on the constructor used) may be automatically registered in the global Prometheus metrics registry.
Index ¶
- type Counter
- func NewCounter(cv *prometheus.CounterVec) *Counter
- func NewCounterFrom(opts prometheus.CounterOpts, labelNames []string) *Counter
- func (c *Counter) Add(delta float64)
- func (c *Counter) With(labelValues ...string) metrics.Counter
- type Gauge
- func NewGauge(gv *prometheus.GaugeVec) *Gauge
- func NewGaugeFrom(opts prometheus.GaugeOpts, labelNames []string) *Gauge
- func (g *Gauge) Add(delta float64)
- func (g *Gauge) Set(value float64)
- func (g *Gauge) With(labelValues ...string) metrics.Gauge
- type Histogram
- func NewHistogram(hv *prometheus.HistogramVec) *Histogram
- func NewHistogramFrom(opts prometheus.HistogramOpts, labelNames []string) *Histogram
- func (h *Histogram) Observe(value float64)
- func (h *Histogram) With(labelValues ...string) metrics.Histogram
- type Summary
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter implements Counter, via a Prometheus CounterVec.
func NewCounter ¶
func NewCounter(cv *prometheus.CounterVec) *Counter
NewCounter wraps the CounterVec and returns a usable Counter object.
func NewCounterFrom ¶
func NewCounterFrom(opts prometheus.CounterOpts, labelNames []string) *Counter
NewCounterFrom constructs and registers a Prometheus CounterVec, and returns a usable Counter object.
func (*Counter) Add ¶
Add implements Counter.
func (*Counter) With ¶
With implements Counter.
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge implements Gauge, via a Prometheus GaugeVec.
func NewGauge ¶
func NewGauge(gv *prometheus.GaugeVec) *Gauge
NewGauge wraps the GaugeVec and returns a usable Gauge object.
func NewGaugeFrom ¶
func NewGaugeFrom(opts prometheus.GaugeOpts, labelNames []string) *Gauge
NewGaugeFrom constructs and registers a Prometheus GaugeVec, and returns a usable Gauge object.
func (*Gauge) Add ¶
Add is supported by Prometheus GaugeVecs.
func (*Gauge) Set ¶
Set implements Gauge.
func (*Gauge) With ¶
With implements Gauge.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram implements Histogram via a Prometheus HistogramVec. The difference between a Histogram and a Summary is that Histograms require predefined quantile buckets, and can be statistically aggregated.
func NewHistogram ¶
func NewHistogram(hv *prometheus.HistogramVec) *Histogram
NewHistogram wraps the HistogramVec and returns a usable Histogram object.
func NewHistogramFrom ¶
func NewHistogramFrom(opts prometheus.HistogramOpts, labelNames []string) *Histogram
NewHistogramFrom constructs and registers a Prometheus HistogramVec, and returns a usable Histogram object.
func (*Histogram) Observe ¶
Observe implements Histogram.
func (*Histogram) With ¶
With implements Histogram.
type Summary ¶
type Summary struct {
// contains filtered or unexported fields
}
Summary implements Histogram, via a Prometheus SummaryVec. The difference between a Summary and a Histogram is that Summaries don't require predefined quantile buckets, but cannot be statistically aggregated.
func NewSummary ¶
func NewSummary(sv *prometheus.SummaryVec) *Summary
NewSummary wraps the SummaryVec and returns a usable Summary object.
func NewSummaryFrom ¶
func NewSummaryFrom(opts prometheus.SummaryOpts, labelNames []string) *Summary
NewSummaryFrom constructs and registers a Prometheus SummaryVec, and returns a usable Summary object.
func (*Summary) Observe ¶
Observe implements Histogram.
func (*Summary) With ¶
With implements Histogram.
Source Files ¶
- Version
- v0.13.0 (latest)
- Published
- May 29, 2023
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 4 hours ago –
Tools for package owners.