GetMetricWith returns the Gauge 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 Gauge is created. Implications of creating a Gauge without using it and keeping the Gauge for later use are the same as
(labels Labels)
| 220 | // GetMetricWithLabelValues(...string). See there for pros and cons of the two |
| 221 | // methods. |
| 222 | func (v *GaugeVec) GetMetricWith(labels Labels) (Gauge, error) { |
| 223 | metric, err := v.MetricVec.GetMetricWith(labels) |
| 224 | if metric != nil { |
| 225 | return metric.(Gauge), err |
| 226 | } |
| 227 | return nil, err |
| 228 | } |
| 229 | |
| 230 | // WithLabelValues works as GetMetricWithLabelValues, but panics where |
| 231 | // GetMetricWithLabelValues would have returned an error. Not returning an |