From 1d6e2e57db13b349048d19c0220a62d1a7db298e Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Fri, 11 Oct 2024 09:40:13 -0600 Subject: [PATCH] fix: Switch `collector_collect_loop_duration_ms` metric to be a histogram (#1381) ## Which problem is this PR solving? - Recording the value as a guage meant that a lot of values were missed as the older values got overwritten by newer values. This meant the largest value in the interval may not get exported. ## Short description of the changes - Switch `collector_collect_loop_duration_ms` from gauge to histogram to make sure max values are captured. --- collect/collect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collect/collect.go b/collect/collect.go index 3d4cbbd36a..20002b8211 100644 --- a/collect/collect.go +++ b/collect/collect.go @@ -389,7 +389,7 @@ func (i *InMemCollector) collect() { } } - i.Metrics.Gauge("collector_collect_loop_duration_ms", float64(time.Now().Sub(startTime).Milliseconds())) + i.Metrics.Histogram("collector_collect_loop_duration_ms", float64(time.Now().Sub(startTime).Milliseconds())) } }