Skip to content

Commit c8b30a1

Browse files
author
Ben Bytheway
committed
Stackdriver doesn't provide a sum, but it does provide a mean and a
count. By multiplying the mean * count we can get back to the sum.
1 parent 845e9f4 commit c8b30a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

collectors/monitoring_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func (c *MonitoringCollector) reportTimeSeriesMetrics(
302302
ch <- prometheus.MustNewConstHistogram(
303303
metricDesc,
304304
uint64(dist.Count),
305-
0, // Stackdriver does not provide the sum
305+
dist.Mean*float64(dist.Count), // Stackdriver does not provide the sum, but we can fake it
306306
buckets,
307307
labelValues...,
308308
)

0 commit comments

Comments
 (0)