MustNewConstMetric is a version of NewConstMetric that panics where NewConstMetric would have returned an error.
(desc *Desc, valueType ValueType, value float64, labelValues ...string)
| 124 | // MustNewConstMetric is a version of NewConstMetric that panics where |
| 125 | // NewConstMetric would have returned an error. |
| 126 | func MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) Metric { |
| 127 | m, err := NewConstMetric(desc, valueType, value, labelValues...) |
| 128 | if err != nil { |
| 129 | panic(err) |
| 130 | } |
| 131 | return m |
| 132 | } |
| 133 | |
| 134 | // NewConstMetricWithCreatedTimestamp does the same thing as NewConstMetric, but generates Counters |
| 135 | // with created timestamp set and returns an error for other metric types. |