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

Method GetMetricWithLabelValues

prometheus/gauge.go:202–208  ·  view source on GitHub ↗

GetMetricWithLabelValues returns the Gauge 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 Gauge is created. It is possible to call this method without using the returned Gauge to only create

(lvs ...string)

Source from the content-addressed store, hash-verified

200// latter has a much more readable (albeit more verbose) syntax, but it comes
201// with a performance overhead (for creating and processing the Labels map).
202func (v *GaugeVec) GetMetricWithLabelValues(lvs ...string) (Gauge, error) {
203 metric, err := v.MetricVec.GetMetricWithLabelValues(lvs...)
204 if metric != nil {
205 return metric.(Gauge), err
206 }
207 return nil, err
208}
209
210// GetMetricWith returns the Gauge for the given Labels map (the label names
211// 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