diff --git a/app/multitenant/aws_collector.go b/app/multitenant/aws_collector.go index d8e8c1721..2365f8c55 100644 --- a/app/multitenant/aws_collector.go +++ b/app/multitenant/aws_collector.go @@ -60,10 +60,11 @@ var ( Help: "Total count of reports found in the in-process cache.", }) - reportSize = prometheus.NewCounter(prometheus.CounterOpts{ + reportSizeHistogram = prometheus.NewHistogram(prometheus.HistogramOpts{ Namespace: "scope", - Name: "report_size_bytes_total", - Help: "Total compressed size of reports received in bytes.", + Name: "report_size_bytes", + Help: "Distribution of memcache report sizes", + Buckets: prometheus.ExponentialBuckets(4096, 2.0, 10), }) natsRequests = prometheus.NewCounterVec(prometheus.CounterOpts{ @@ -79,7 +80,7 @@ func init() { prometheus.MustRegister(dynamoValueSize) prometheus.MustRegister(inProcessCacheRequests) prometheus.MustRegister(inProcessCacheHits) - prometheus.MustRegister(reportSize) + prometheus.MustRegister(reportSizeHistogram) prometheus.MustRegister(natsRequests) } @@ -346,7 +347,7 @@ func (c *awsCollector) Add(ctx context.Context, rep report.Report) error { // first, encode the report into a buffer and record its size var buf bytes.Buffer rep.WriteBinary(&buf) - reportSize.Add(float64(buf.Len())) + reportSizeHistogram.Observe(float64(buf.Len())) // second, put the report on s3 now := time.Now()