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

Method GetMetricWithLabelValues

prometheus/histogram.go:1225–1231  ·  view source on GitHub ↗

GetMetricWithLabelValues returns the Histogram for the given slice of label values (same order as the variable labels in Desc). If that combination of label values is accessed for the first time, a new Histogram is created. It is possible to call this method without using the returned Histogram to

(lvs ...string)

Source from the content-addressed store, hash-verified

1223// with a performance overhead (for creating and processing the Labels map).
1224// See also the GaugeVec example.
1225func (v *HistogramVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) {
1226 metric, err := v.MetricVec.GetMetricWithLabelValues(lvs...)
1227 if metric != nil {
1228 return metric.(Observer), err
1229 }
1230 return nil, err
1231}
1232
1233// GetMetricWith returns the Histogram for the given Labels map (the label names
1234// must match those of the variable labels in Desc). If that label map is

Callers 1

WithLabelValuesMethod · 0.95

Calls 1

Tested by

no test coverage detected