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

Method NewHistogramVec

prometheus/histogram.go:1187–1199  ·  view source on GitHub ↗

NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts.

(opts HistogramVecOpts)

Source from the content-addressed store, hash-verified

1185
1186// NewHistogramVec creates a new HistogramVec based on the provided HistogramVecOpts.
1187func (v2) NewHistogramVec(opts HistogramVecOpts) *HistogramVec {
1188 desc := V2.NewDesc(
1189 BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
1190 opts.Help,
1191 opts.VariableLabels,
1192 opts.ConstLabels,
1193 )
1194 return &HistogramVec{
1195 MetricVec: NewMetricVec(desc, func(lvs ...string) Metric {
1196 return newHistogram(desc, opts.HistogramOpts, lvs...)
1197 }),
1198 }
1199}
1200
1201// GetMetricWithLabelValues returns the Histogram for the given slice of label
1202// values (same order as the variable labels in Desc). If that combination of

Callers 4

NewHistogramVecFunction · 0.45
WrapHandlerMethod · 0.45
instrumentHandlerFuncFunction · 0.45
instrumentRoundTripperFunction · 0.45

Calls 4

BuildFQNameFunction · 0.85
NewMetricVecFunction · 0.85
newHistogramFunction · 0.85
NewDescMethod · 0.80

Tested by

no test coverage detected