(metric prometheus.Gauge)
| 15 | } |
| 16 | |
| 17 | func GetGaugeValue(metric prometheus.Gauge) (float64, error) { |
| 18 | m := &dto.Metric{} |
| 19 | err := metric.Write(m) |
| 20 | if err != nil { |
| 21 | return 0, err |
| 22 | } |
| 23 | return m.Gauge.GetValue(), nil |
| 24 | } |
| 25 | |
| 26 | func GetGaugeVecValue(metric *prometheus.GaugeVec, labels ...string) (float64, error) { |
| 27 | m := &dto.Metric{} |