Documentation
¶
Index ¶
- Variables
- func Setup(address string, logger log.Logger) *http.ServeMux
- type Counter
- type DurationObserver
- type Gauge
- type HistTimer
- type Histogram
- type Set
- func (s *Set) Collect(ch chan<- prometheus.Metric)
- func (s *Set) Describe(ch chan<- *prometheus.Desc)
- func (s *Set) GetOrCreateCounter(name string, help ...string) (prometheus.Counter, error)
- func (s *Set) GetOrCreateGauge(name string, help ...string) (prometheus.Gauge, error)
- func (s *Set) GetOrCreateHistogram(name string, help ...string) (prometheus.Histogram, error)
- func (s *Set) GetOrCreateSummary(name string, help ...string) (prometheus.Summary, error)
- func (s *Set) GetOrCreateSummaryExt(name string, window time.Duration, quantiles map[float64]float64, ...) (prometheus.Summary, error)
- func (s *Set) ListMetricNames() []string
- func (s *Set) NewCounter(name string, help ...string) (prometheus.Counter, error)
- func (s *Set) NewGauge(name string, help ...string) (prometheus.Gauge, error)
- func (s *Set) NewHistogram(name string, help ...string) (prometheus.Histogram, error)
- func (s *Set) NewSummary(name string, help ...string) (prometheus.Summary, error)
- func (s *Set) NewSummaryExt(name string, window time.Duration, quantiles map[float64]float64, ...) (prometheus.Summary, error)
- func (s *Set) UnregisterAllMetrics()
- func (s *Set) UnregisterMetric(name string) bool
- type Summary
- type ValueGetter
Constants ¶
This section is empty.
Variables ¶
var EnabledExpensive = false
Functions ¶
Types ¶
type Counter ¶
type Counter interface { prometheus.Counter ValueGetter AddInt(v int) AddUint64(v uint64) }
func GetOrCreateCounter ¶
GetOrCreateCounter returns registered counter with the given name or creates new counter if the registry doesn't contain counter with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned counter is safe to use from concurrent goroutines.
Performance tip: prefer NewCounter instead of GetOrCreateCounter.
func NewCounter ¶
NewCounter registers and returns new counter with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned counter is safe to use from concurrent goroutines.
type DurationObserver ¶
type Gauge ¶
type Gauge interface { prometheus.Gauge ValueGetter SetUint32(v uint32) SetUint64(v uint64) SetInt(v int) }
func GetOrCreateGauge ¶
GetOrCreateGauge returns registered gauge with the given name or creates new gauge if the registry doesn't contain gauge with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned gauge is safe to use from concurrent goroutines.
Performance tip: prefer NewGauge instead of GetOrCreateGauge.
type HistTimer ¶
type HistTimer struct { Histogram // contains filtered or unexported fields }
func NewHistTimer ¶
type Histogram ¶
type Histogram interface { prometheus.Histogram DurationObserver }
func GetOrCreateHistogram ¶
GetOrCreateHistogram returns registered histogram with the given name or creates new histogram if the registry doesn't contain histogram with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned histogram is safe to use from concurrent goroutines.
Performance tip: prefer NewHistogram instead of GetOrCreateHistogram.
func NewHistogram ¶
NewHistogram creates and returns new histogram with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned histogram is safe to use from concurrent goroutines.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a set of metrics.
Metrics belonging to a set are exported separately from global metrics.
Set.WritePrometheus must be called for exporting metrics from the set.
func NewSet ¶
func NewSet() *Set
NewSet creates new set of metrics.
Pass the set to RegisterSet() function in order to export its metrics via global WritePrometheus() call.
func (*Set) Collect ¶
func (s *Set) Collect(ch chan<- prometheus.Metric)
func (*Set) Describe ¶
func (s *Set) Describe(ch chan<- *prometheus.Desc)
func (*Set) GetOrCreateCounter ¶
GetOrCreateCounter returns registered counter in s with the given name or creates new counter if s doesn't contain counter with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned counter is safe to use from concurrent goroutines.
Performance tip: prefer NewCounter instead of GetOrCreateCounter.
func (*Set) GetOrCreateGauge ¶
GetOrCreateGauge returns registered gauge with the given name in s or creates new gauge if s doesn't contain gauge with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned gauge is safe to use from concurrent goroutines.
Performance tip: prefer NewGauge instead of GetOrCreateGauge.
func (*Set) GetOrCreateHistogram ¶
GetOrCreateHistogram returns registered histogram in s with the given name or creates new histogram if s doesn't contain histogram with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned histogram is safe to use from concurrent goroutines.
Performance tip: prefer NewHistogram instead of GetOrCreateHistogram.
func (*Set) GetOrCreateSummary ¶
GetOrCreateSummary returns registered summary with the given name in s or creates new summary if s doesn't contain summary with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned summary is safe to use from concurrent goroutines.
Performance tip: prefer NewSummary instead of GetOrCreateSummary.
func (*Set) GetOrCreateSummaryExt ¶
func (s *Set) GetOrCreateSummaryExt(name string, window time.Duration, quantiles map[float64]float64, help ...string) (prometheus.Summary, error)
GetOrCreateSummaryExt returns registered summary with the given name, window and quantiles in s or creates new summary if s doesn't contain summary with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned summary is safe to use from concurrent goroutines.
Performance tip: prefer NewSummaryExt instead of GetOrCreateSummaryExt.
func (*Set) ListMetricNames ¶
ListMetricNames returns sorted list of all the metrics in s.
func (*Set) NewCounter ¶
NewCounter registers and returns new counter with the given name in the s.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned counter is safe to use from concurrent goroutines.
func (*Set) NewGauge ¶
NewGauge registers and returns gauge with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
f must be safe for concurrent calls.
The returned gauge is safe to use from concurrent goroutines.
func (*Set) NewHistogram ¶
NewHistogram creates and returns new histogram in s with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned histogram is safe to use from concurrent goroutines.
func (*Set) NewSummary ¶
NewSummary creates and returns new summary with the given name in s.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned summary is safe to use from concurrent goroutines.
func (*Set) NewSummaryExt ¶
func (s *Set) NewSummaryExt(name string, window time.Duration, quantiles map[float64]float64, help ...string) (prometheus.Summary, error)
NewSummaryExt creates and returns new summary in s with the given name, window and quantiles.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned summary is safe to use from concurrent goroutines.
func (*Set) UnregisterAllMetrics ¶
func (s *Set) UnregisterAllMetrics()
UnregisterAllMetrics de-registers all metrics registered in s.
func (*Set) UnregisterMetric ¶
UnregisterMetric removes metric with the given name from s.
True is returned if the metric has been removed. False is returned if the given metric is missing in s.
type Summary ¶
type Summary interface { prometheus.Summary DurationObserver }
func GetOrCreateSummary ¶
GetOrCreateSummary returns registered summary with the given name or creates new summary if the registry doesn't contain summary with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned summary is safe to use from concurrent goroutines.
Performance tip: prefer NewSummary instead of GetOrCreateSummary.
func NewSummary ¶
NewSummary creates and returns new summary with the given name.
name must be valid Prometheus-compatible metric with possible labels. For instance,
- foo
- foo{bar="baz"}
- foo{bar="baz",aaa="b"}
The returned summary is safe to use from concurrent goroutines.