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

Method GetMetricWith

prometheus/summary.go:633–639  ·  view source on GitHub ↗

GetMetricWith returns the Summary for the given Labels map (the label names must match those of the variable labels in Desc). If that label map is accessed for the first time, a new Summary is created. Implications of creating a Summary without using it and keeping the Summary for later use are the

(labels Labels)

Source from the content-addressed store, hash-verified

631// GetMetricWithLabelValues(...string). See there for pros and cons of the two
632// methods.
633func (v *SummaryVec) GetMetricWith(labels Labels) (Observer, error) {
634 metric, err := v.MetricVec.GetMetricWith(labels)
635 if metric != nil {
636 return metric.(Observer), err
637 }
638 return nil, err
639}
640
641// WithLabelValues works as GetMetricWithLabelValues, but panics where
642// GetMetricWithLabelValues would have returned an error. Not returning an

Callers 1

WithMethod · 0.95

Calls 1

GetMetricWithMethod · 0.65

Tested by

no test coverage detected