MCPcopy
hub / github.com/grafana/tempo / GetGaugeVecValue

Function GetGaugeVecValue

pkg/util/test/metrics.go:26–33  ·  view source on GitHub ↗
(metric *prometheus.GaugeVec, labels ...string)

Source from the content-addressed store, hash-verified

24}
25
26func 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
35func GetCounterVecValue(metric *prometheus.CounterVec, label string) (float64, error) {
36 m := &dto.Metric{}

Callers 1

Calls 2

WriteMethod · 0.65
GetValueMethod · 0.45

Tested by 1