Skip to content

Import path: gitlab.soludian.com/soludian/fountain/libs/metrics/prometheus

prometheus

go
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.

go
type Counter struct {
    // contains filtered or unexported fields
}

func NewCounter

go
func NewCounter(cv *prometheus.CounterVec) *Counter

NewCounter wraps the CounterVec and returns a usable Counter object.

func NewCounterFrom

go
func NewCounterFrom(opts prometheus.CounterOpts, labelNames ...string) *Counter

NewCounterFrom constructs and registers a Prometheus CounterVec, and returns a usable Counter object.

func (*Counter) Add

go
func (c *Counter) Add(delta float64)

Add implements Counter.

func (*Counter) With

go
func (c *Counter) With(labelValues ...string) metrics.Counter

With implements Counter.

type Gauge

Gauge implements Gauge, via a Prometheus GaugeVec.

go
type Gauge struct {
    // contains filtered or unexported fields
}

func NewGauge

go
func NewGauge(gv *prometheus.GaugeVec) *Gauge

NewGauge wraps the GaugeVec and returns a usable Gauge object.

func NewGaugeFrom

go
func NewGaugeFrom(opts prometheus.GaugeOpts, labelNames ...string) *Gauge

NewGaugeFrom constructs and registers a Prometheus GaugeVec, and returns a usable Gauge object.

func (*Gauge) Add

go
func (g *Gauge) Add(delta float64)

Add is supported by Prometheus GaugeVecs.

func (*Gauge) Set

go
func (g *Gauge) Set(value float64)

Set implements Gauge.

func (*Gauge) With

go
func (g *Gauge) With(labelValues ...string) metrics.Gauge

With 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.

go
type Histogram struct {
    // contains filtered or unexported fields
}

func NewHistogram

go
func NewHistogram(hv *prometheus.HistogramVec) *Histogram

NewHistogram wraps the HistogramVec and returns a usable Histogram object.

func NewHistogramFrom

go
func NewHistogramFrom(opts prometheus.HistogramOpts, labelNames ...string) *Histogram

NewHistogramFrom constructs and registers a Prometheus HistogramVec, and returns a usable Histogram object.

func (*Histogram) Observe

go
func (h *Histogram) Observe(value float64)

Observe implements Histogram.

func (*Histogram) With

go
func (h *Histogram) With(labelValues ...string) metrics.Histogram

With 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.

go
type Summary struct {
    // contains filtered or unexported fields
}

func NewSummary

go
func NewSummary(sv *prometheus.SummaryVec) *Summary

NewSummary wraps the SummaryVec and returns a usable Summary object.

func NewSummaryFrom

go
func NewSummaryFrom(opts prometheus.SummaryOpts, labelNames []string) *Summary

NewSummaryFrom constructs and registers a Prometheus SummaryVec, and returns a usable Summary object.

func (*Summary) Observe

go
func (s *Summary) Observe(value float64)

Observe implements Histogram.

func (*Summary) With

go
func (s *Summary) With(labelValues ...string) metrics.Histogram

With implements Histogram.

Generated by gomarkdoc