From 763944f67350889db04afc650bfd6fdabfb0bf06 Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Sun, 14 Jun 2020 17:09:24 +0800 Subject: [PATCH] rcd: fix incorrect prometheus metrics - fixes #4341 This was caused by using the stats group from the context passed in by the rcd rather than the global stats group. Signed-off-by: Gary Kim --- fs/accounting/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/accounting/prometheus.go b/fs/accounting/prometheus.go index 47e9c7594..e34bc0146 100644 --- a/fs/accounting/prometheus.go +++ b/fs/accounting/prometheus.go @@ -76,7 +76,7 @@ func (c *RcloneCollector) Describe(ch chan<- *prometheus.Desc) { // Collect is part of the Collector interface: https://godoc.org/github.com/prometheus/client_golang/prometheus#Collector func (c *RcloneCollector) Collect(ch chan<- prometheus.Metric) { - s := GlobalStats() + s := groups.sum() s.mu.RLock() ch <- prometheus.MustNewConstMetric(c.bytesTransferred, prometheus.CounterValue, float64(s.bytes))