(metric *prometheus.GaugeVec, labels ...string)
| 24 | } |
| 25 | |
| 26 | func GetGaugeVecValue(metric *prometheus.GaugeVec, labels ...string) (float64, error) { |
| 27 | m := &dto.Metric{} |
| 28 | err := metric.WithLabelValues(labels...).Write(m) |
| 29 | if err != nil { |
| 30 | return 0, err |
| 31 | } |
| 32 | return m.Gauge.GetValue(), nil |
| 33 | } |
| 34 | |
| 35 | func GetCounterVecValue(metric *prometheus.CounterVec, label string) (float64, error) { |
| 36 | m := &dto.Metric{} |