MCPcopy
hub / github.com/prometheus/client_golang / NewCounterFunc

Function NewCounterFunc

prometheus/promauto/auto.go:183–185  ·  view source on GitHub ↗

NewCounterFunc works like the function of the same name in the prometheus package but it automatically registers the CounterFunc with the prometheus.DefaultRegisterer. If the registration fails, NewCounterFunc panics.

(opts prometheus.CounterOpts, function func() float64)

Source from the content-addressed store, hash-verified

181// prometheus.DefaultRegisterer. If the registration fails, NewCounterFunc
182// panics.
183func NewCounterFunc(opts prometheus.CounterOpts, function func() float64) prometheus.CounterFunc {
184 return With(prometheus.DefaultRegisterer).NewCounterFunc(opts, function)
185}
186
187// NewGauge works like the function of the same name in the prometheus package
188// but it automatically registers the Gauge with the

Callers

nothing calls this directly

Calls 2

WithFunction · 0.85
NewCounterFuncMethod · 0.80

Tested by

no test coverage detected