WithLabelValues works as GetMetricWithLabelValues, but panics where GetMetricWithLabelValues would have returned an error. Not returning an error allows shortcuts like myVec.WithLabelValues("404", "GET").Observe(42.21)
(lvs ...string)
| 644 | // |
| 645 | // myVec.WithLabelValues("404", "GET").Observe(42.21) |
| 646 | func (v *SummaryVec) WithLabelValues(lvs ...string) Observer { |
| 647 | s, err := v.GetMetricWithLabelValues(lvs...) |
| 648 | if err != nil { |
| 649 | panic(err) |
| 650 | } |
| 651 | return s |
| 652 | } |
| 653 | |
| 654 | // With works as GetMetricWith, but panics where GetMetricWithLabels would have |
| 655 | // returned an error. Not returning an error allows shortcuts like |