diff --git a/internal/exporter/metrics.go b/internal/exporter/metrics.go index f672de9..ba593f8 100644 --- a/internal/exporter/metrics.go +++ b/internal/exporter/metrics.go @@ -193,15 +193,19 @@ func (m *Metrics) collectReqeustDataMetrics(ch chan<- prometheus.Metric, queue * sum += latency count++ - var cumulativeCount uint64 for _, bound := range bucketBounds { if latency <= bound { - cumulativeCount++ + buckets[bound]++ } - buckets[bound] += cumulativeCount } } + var cumulativeCount uint64 + for _, bound := range bucketBounds { + cumulativeCount += buckets[bound] + buckets[bound] = cumulativeCount + } + m.counter += uint(len(data)) ch <- prometheus.MustNewConstMetric( m.metricRequestsTotal,