From ded35ef20dd070972ba43b2b3ec81df39f50e69e Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Sun, 31 Mar 2024 15:10:29 -0700 Subject: [PATCH] expose compactor metrics Signed-off-by: Ben Ye --- tsdb/compact.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsdb/compact.go b/tsdb/compact.go index 3d8d9130c..4d345ffd4 100644 --- a/tsdb/compact.go +++ b/tsdb/compact.go @@ -96,7 +96,8 @@ type CompactorMetrics struct { ChunkRange prometheus.Histogram } -func newCompactorMetrics(r prometheus.Registerer) *CompactorMetrics { +// NewCompactorMetrics initializes metrics for Compactor. +func NewCompactorMetrics(r prometheus.Registerer) *CompactorMetrics { m := &CompactorMetrics{} m.Ran = prometheus.NewCounter(prometheus.CounterOpts{ @@ -203,7 +204,7 @@ func NewLeveledCompactorWithOptions(ctx context.Context, r prometheus.Registerer ranges: ranges, chunkPool: pool, logger: l, - metrics: newCompactorMetrics(r), + metrics: NewCompactorMetrics(r), ctx: ctx, maxBlockChunkSegmentSize: maxBlockChunkSegmentSize, mergeFunc: mergeFunc,