Import path:
gitlab.soludian.com/soludian/fountain/libs/metrics/prometheus
prometheus
import "gitlab.soludian.com/soludian/fountain/libs/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
Counter implements Counter, via a Prometheus CounterVec.
type Counter struct {
// contains filtered or unexported fields
}func NewCounter
func NewCounter(cv *prometheus.CounterVec) *CounterNewCounter wraps the CounterVec and returns a usable Counter object.
func NewCounterFrom
func NewCounterFrom(opts prometheus.CounterOpts, labelNames ...string) *CounterNewCounterFrom constructs and registers a Prometheus CounterVec, and returns a usable Counter object.
func (*Counter) Add
func (c *Counter) Add(delta float64)Add implements Counter.
func (*Counter) With
func (c *Counter) With(labelValues ...string) metrics.CounterWith implements Counter.
type Gauge
Gauge implements Gauge, via a Prometheus GaugeVec.
type Gauge struct {
// contains filtered or unexported fields
}func NewGauge
func NewGauge(gv *prometheus.GaugeVec) *GaugeNewGauge wraps the GaugeVec and returns a usable Gauge object.
func NewGaugeFrom
func NewGaugeFrom(opts prometheus.GaugeOpts, labelNames ...string) *GaugeNewGaugeFrom constructs and registers a Prometheus GaugeVec, and returns a usable Gauge object.
func (*Gauge) Add
func (g *Gauge) Add(delta float64)Add is supported by Prometheus GaugeVecs.
func (*Gauge) Set
func (g *Gauge) Set(value float64)Set implements Gauge.
func (*Gauge) With
func (g *Gauge) With(labelValues ...string) metrics.GaugeWith implements Gauge.
type Histogram
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.
type Histogram struct {
// contains filtered or unexported fields
}func NewHistogram
func NewHistogram(hv *prometheus.HistogramVec) *HistogramNewHistogram wraps the HistogramVec and returns a usable Histogram object.
func NewHistogramFrom
func NewHistogramFrom(opts prometheus.HistogramOpts, labelNames ...string) *HistogramNewHistogramFrom constructs and registers a Prometheus HistogramVec, and returns a usable Histogram object.
func (*Histogram) Observe
func (h *Histogram) Observe(value float64)Observe implements Histogram.
func (*Histogram) With
func (h *Histogram) With(labelValues ...string) metrics.HistogramWith implements Histogram.
type Summary
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.
type Summary struct {
// contains filtered or unexported fields
}func NewSummary
func NewSummary(sv *prometheus.SummaryVec) *SummaryNewSummary wraps the SummaryVec and returns a usable Summary object.
func NewSummaryFrom
func NewSummaryFrom(opts prometheus.SummaryOpts, labelNames []string) *SummaryNewSummaryFrom constructs and registers a Prometheus SummaryVec, and returns a usable Summary object.
func (*Summary) Observe
func (s *Summary) Observe(value float64)Observe implements Histogram.
func (*Summary) With
func (s *Summary) With(labelValues ...string) metrics.HistogramWith implements Histogram.
Generated by gomarkdoc