go.d cockroachdb fix calculation (#17659)
Ilya Mashchenko committed
May 14, 2024 at 21:32 UTC
4623e9b9b53890cf6a57c1c937bef852a6be987a
1 file changed
+3
-3
src/go/collectors/go.d.plugin/modules/cockroachdb/collect.go
+3
-3
@@ -40,11 +40,11 @@ const precision = 1000
40
func collectScraped(scraped prometheus.Series, metricList []string) map[string]float64 {
41
mx := make(map[string]float64)
42
for _, name := range metricList {
43
- if ms := scraped.FindByName(name); ms.Len() == 1 {
43
+ for _, m := range scraped.FindByName(name) {
44
if isMetricFloat(name) {
45
- mx[name] = ms.Max() * precision
45
+ mx[name] += m.Value * precision
46
} else {
47
- mx[name] = ms.Max()
47
+ mx[name] += m.Value
48
}
49
}
50
}