...

Package prometheus

import "golang.conradwood.net/go-easyops/prometheus"
Overview
Index

Overview ▾

wrapper around prometheus SDK/Client.

the prometheus SDK API has changed occassionally in the past. This package, different to the SDK also implements a timeout. That is, if a metric is not set for some time it will be removed from the exported metrics. (The SDK exports the last set value forever).

Index ▾

func GetGatherer() *promRegistry
func GetRegistry() *pm.Registry
func MetricNames(reg *pm.Registry) ([]string, error)
func MustRegister(cols ...pm.Collector)
func NonstandMetricNames(reg *pm.Registry) ([]string, error)
func Register(cols ...pm.Collector) error
func SetExpiry(expiry time.Duration)
type CounterOpts
type CounterVec
    func NewCounter(opts CounterOpts) *CounterVec
    func NewCounterVec(opts CounterOpts, label_names []string) *CounterVec
    func (c *CounterVec) Collect(x chan<- pm.Metric)
    func (c *CounterVec) Describe(x chan<- *pm.Desc)
    func (g *CounterVec) Inc()
    func (g *CounterVec) PMCollector() pm.Collector
    func (g *CounterVec) With(l Labels) pm.Counter
type GaugeOpts
type GaugeVec
    func NewGauge(opts GaugeOpts) *GaugeVec
    func NewGaugeVec(opts GaugeOpts, label_names []string) *GaugeVec
    func (c *GaugeVec) Collect(x chan<- pm.Metric)
    func (g *GaugeVec) Dec()
    func (c *GaugeVec) Describe(x chan<- *pm.Desc)
    func (g *GaugeVec) Inc()
    func (g *GaugeVec) PMCollector() pm.Collector
    func (g *GaugeVec) Set(f float64)
    func (g *GaugeVec) With(l Labels) pm.Gauge
type HistogramOpts
type HistogramVec
    func NewHistogram(opts HistogramOpts) *HistogramVec
    func NewHistogramVec(opts HistogramOpts, label_names []string) *HistogramVec
    func (c *HistogramVec) Collect(x chan<- pm.Metric)
    func (c *HistogramVec) Describe(x chan<- *pm.Desc)
    func (g *HistogramVec) PMCollector() pm.Collector
    func (g *HistogramVec) With(l Labels) pm.Observer
type Labels
type SummaryOpts
type SummaryVec
    func NewSummary(opts SummaryOpts) *SummaryVec
    func NewSummaryVec(opts SummaryOpts, label_names []string) *SummaryVec
    func (c *SummaryVec) Collect(x chan<- pm.Metric)
    func (c *SummaryVec) Describe(x chan<- *pm.Desc)
    func (g *SummaryVec) Observe(f float64)
    func (g *SummaryVec) PMCollector() pm.Collector
    func (g *SummaryVec) With(l Labels) pm.Observer
    func (g *SummaryVec) WithLabelValues(vs ...string) pm.Observer

Package files

collector.go countervec.go gaugevec.go histogramvec.go prometheus.go registry.go summaryvec.go usage_tracker.go

func GetGatherer

func GetGatherer() *promRegistry

func GetRegistry

func GetRegistry() *pm.Registry

func MetricNames

func MetricNames(reg *pm.Registry) ([]string, error)

func MustRegister

func MustRegister(cols ...pm.Collector)

func NonstandMetricNames

func NonstandMetricNames(reg *pm.Registry) ([]string, error)

func Register

func Register(cols ...pm.Collector) error

func SetExpiry

func SetExpiry(expiry time.Duration)

type CounterOpts

type CounterOpts pm.CounterOpts

type CounterVec

type CounterVec struct {
    // contains filtered or unexported fields
}

func NewCounter

func NewCounter(opts CounterOpts) *CounterVec

func NewCounterVec

func NewCounterVec(opts CounterOpts, label_names []string) *CounterVec

func (*CounterVec) Collect

func (c *CounterVec) Collect(x chan<- pm.Metric)

func (*CounterVec) Describe

func (c *CounterVec) Describe(x chan<- *pm.Desc)

func (*CounterVec) Inc

func (g *CounterVec) Inc()

func (*CounterVec) PMCollector

func (g *CounterVec) PMCollector() pm.Collector

func (*CounterVec) With

func (g *CounterVec) With(l Labels) pm.Counter

type GaugeOpts

type GaugeOpts pm.GaugeOpts

type GaugeVec

type GaugeVec struct {
    // contains filtered or unexported fields
}

func NewGauge

func NewGauge(opts GaugeOpts) *GaugeVec

func NewGaugeVec

func NewGaugeVec(opts GaugeOpts, label_names []string) *GaugeVec

func (*GaugeVec) Collect

func (c *GaugeVec) Collect(x chan<- pm.Metric)

func (*GaugeVec) Dec

func (g *GaugeVec) Dec()

func (*GaugeVec) Describe

func (c *GaugeVec) Describe(x chan<- *pm.Desc)

func (*GaugeVec) Inc

func (g *GaugeVec) Inc()

func (*GaugeVec) PMCollector

func (g *GaugeVec) PMCollector() pm.Collector

func (*GaugeVec) Set

func (g *GaugeVec) Set(f float64)

func (*GaugeVec) With

func (g *GaugeVec) With(l Labels) pm.Gauge

type HistogramOpts

type HistogramOpts pm.HistogramOpts

type HistogramVec

type HistogramVec struct {
    // contains filtered or unexported fields
}

func NewHistogram

func NewHistogram(opts HistogramOpts) *HistogramVec

func NewHistogramVec

func NewHistogramVec(opts HistogramOpts, label_names []string) *HistogramVec

type Desc pm.Desc type Metric pm.Metric

func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc {
	d := pm.NewDesc(fqName, help, variableLabels, pm.Labels(constLabels))
	return *Desc(d)
}

func (*HistogramVec) Collect

func (c *HistogramVec) Collect(x chan<- pm.Metric)

func (*HistogramVec) Describe

func (c *HistogramVec) Describe(x chan<- *pm.Desc)

func (*HistogramVec) PMCollector

func (g *HistogramVec) PMCollector() pm.Collector

func (*HistogramVec) With

func (g *HistogramVec) With(l Labels) pm.Observer

type Labels

type Labels pm.Labels

type SummaryOpts

type SummaryOpts pm.SummaryOpts

type SummaryVec

type SummaryVec struct {
    // contains filtered or unexported fields
}

func NewSummary

func NewSummary(opts SummaryOpts) *SummaryVec

func NewSummaryVec

func NewSummaryVec(opts SummaryOpts, label_names []string) *SummaryVec

func (*SummaryVec) Collect

func (c *SummaryVec) Collect(x chan<- pm.Metric)

func (*SummaryVec) Describe

func (c *SummaryVec) Describe(x chan<- *pm.Desc)

func (*SummaryVec) Observe

func (g *SummaryVec) Observe(f float64)

func (*SummaryVec) PMCollector

func (g *SummaryVec) PMCollector() pm.Collector

func (*SummaryVec) With

func (g *SummaryVec) With(l Labels) pm.Observer

func (*SummaryVec) WithLabelValues

func (g *SummaryVec) WithLabelValues(vs ...string) pm.Observer