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

Method NewCounterVec

prometheus/promauto/auto.go:273–279  ·  view source on GitHub ↗

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

(opts prometheus.CounterOpts, labelNames []string)

Source from the content-addressed store, hash-verified

271// package but it automatically registers the CounterVec with the Factory's
272// Registerer.
273func (f Factory) NewCounterVec(opts prometheus.CounterOpts, labelNames []string) *prometheus.CounterVec {
274 c := prometheus.NewCounterVec(opts, labelNames)
275 if f.r != nil {
276 f.r.MustRegister(c)
277 }
278 return c
279}
280
281// NewCounterFunc works like the function of the same name in the prometheus
282// package but it automatically registers the CounterFunc with the Factory's

Callers 2

TestLabelCheckFunction · 0.45
NewCounterVecFunction · 0.45

Calls 2

NewCounterVecFunction · 0.92
MustRegisterMethod · 0.65

Tested by 1

TestLabelCheckFunction · 0.36