(metric *prometheus.CounterVec, label string)
| 33 | } |
| 34 | |
| 35 | func GetCounterVecValue(metric *prometheus.CounterVec, label string) (float64, error) { |
| 36 | m := &dto.Metric{} |
| 37 | if err := metric.WithLabelValues(label).Write(m); err != nil { |
| 38 | return 0, err |
| 39 | } |
| 40 | return m.Counter.GetValue(), nil |
| 41 | } |
| 42 | |
| 43 | func MustGetCounterValue(metric prometheus.Counter) float64 { |
| 44 | value, err := GetCounterValue(metric) |