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

Method NewGauge

prometheus/promauto/auto.go:294–300  ·  view source on GitHub ↗

NewGauge works like the function of the same name in the prometheus package but it automatically registers the Gauge with the Factory's Registerer.

(opts prometheus.GaugeOpts)

Source from the content-addressed store, hash-verified

292// NewGauge works like the function of the same name in the prometheus package
293// but it automatically registers the Gauge with the Factory's Registerer.
294func (f Factory) NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge {
295 g := prometheus.NewGauge(opts)
296 if f.r != nil {
297 f.r.MustRegister(g)
298 }
299 return g
300}
301
302// NewGaugeVec works like the function of the same name in the prometheus
303// package but it automatically registers the GaugeVec with the Factory's

Callers 4

newThirdPartyLibFooFunction · 0.80
NewGaugeFunction · 0.80
runMainFunction · 0.80
instrumentRoundTripperFunction · 0.80

Calls 2

NewGaugeFunction · 0.92
MustRegisterMethod · 0.65

Tested by 1

newThirdPartyLibFooFunction · 0.64