diff --git a/CHANGELOG.md b/CHANGELOG.md index d1df44a4a63..caf6747dc71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * [ENHANCEMENT] Improve readability of cpu and memory metrics on operational dashboard [#764](https://github.com/grafana/tempo/pull/764) (@bboreham) * [ENHANCEMENT] Add `azure_request_duration_seconds` metric. [#767](https://github.com/grafana/tempo/pull/767) (@JosephWoodward) * [ENHANCEMENT] Add `s3_request_duration_seconds` metric. [#776](https://github.com/grafana/tempo/pull/776) (@JosephWoodward) +* [ENHANCEMENT] Add `tempo_ingester_flush_size_bytes` metric. [#777](https://github.com/grafana/tempo/pull/777) (@bboreham) ## v1.0.1 diff --git a/modules/ingester/flush.go b/modules/ingester/flush.go index bdbd291eb36..bf05a9f7ca1 100644 --- a/modules/ingester/flush.go +++ b/modules/ingester/flush.go @@ -36,6 +36,12 @@ var ( Help: "Records the amount of time to flush a complete block.", Buckets: prometheus.ExponentialBuckets(1, 2, 10), }) + metricFlushSize = promauto.NewHistogram(prometheus.HistogramOpts{ + Namespace: "tempo", + Name: "ingester_flush_size_bytes", + Help: "Size in bytes of blocks flushed.", + Buckets: prometheus.ExponentialBuckets(1024*1024, 2, 10), // from 1MB up to 1GB + }) ) const ( @@ -275,6 +281,7 @@ func (i *Ingester) handleFlush(userID string, blockID uuid.UUID) (retry bool, er start := time.Now() err = i.store.WriteBlock(ctx, block) metricFlushDuration.Observe(time.Since(start).Seconds()) + metricFlushSize.Observe(float64(block.BlockMeta().Size)) if err != nil { return true, err }