WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allows shortcuts like myVec.WithLabelValues("404", "GET").Add(42)
(lvs ...string)
| 279 | // |
| 280 | // myVec.WithLabelValues("404", "GET").Add(42) |
| 281 | func (v *CounterVec) WithLabelValues(lvs ...string) Counter { |
| 282 | c, err := v.GetMetricWithLabelValues(lvs...) |
| 283 | if err != nil { |
| 284 | panic(err) |
| 285 | } |
| 286 | return c |
| 287 | } |
| 288 | |
| 289 | // With works as GetMetricWith, but panics where GetMetricWithLabels would have |
| 290 | // returned an error. Not returning an error allows shortcuts like |