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

Method NewHistogramVec

prometheus/promauto/auto.go:359–365  ·  view source on GitHub ↗

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

(opts prometheus.HistogramOpts, labelNames []string)

Source from the content-addressed store, hash-verified

357// package but it automatically registers the HistogramVec with the Factory's
358// Registerer.
359func (f Factory) NewHistogramVec(opts prometheus.HistogramOpts, labelNames []string) *prometheus.HistogramVec {
360 h := prometheus.NewHistogramVec(opts, labelNames)
361 if f.r != nil {
362 f.r.MustRegister(h)
363 }
364 return h
365}
366
367// NewUntypedFunc works like the function of the same name in the prometheus
368// package but it automatically registers the UntypedFunc with the Factory's

Callers 2

TestLabelCheckFunction · 0.45
NewHistogramVecFunction · 0.45

Calls 2

NewHistogramVecFunction · 0.92
MustRegisterMethod · 0.65

Tested by 1

TestLabelCheckFunction · 0.36