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

Function NewGaugeFunc

prometheus/promauto/auto.go:204–206  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

202// package but it automatically registers the GaugeFunc with the
203// prometheus.DefaultRegisterer. If the registration fails, NewGaugeFunc panics.
204func NewGaugeFunc(opts prometheus.GaugeOpts, function func() float64) prometheus.GaugeFunc {
205 return With(prometheus.DefaultRegisterer).NewGaugeFunc(opts, function)
206}
207
208// NewSummary works like the function of the same name in the prometheus package
209// but it automatically registers the Summary with the

Callers

nothing calls this directly

Calls 2

WithFunction · 0.85
NewGaugeFuncMethod · 0.80

Tested by

no test coverage detected