expose compactor metrics

Signed-off-by: Ben Ye <benye@amazon.com>
This commit is contained in:
Ben Ye 2024-03-31 15:10:29 -07:00
parent b51bbdd7ad
commit ded35ef20d
1 changed files with 3 additions and 2 deletions

View File

@ -96,7 +96,8 @@ type CompactorMetrics struct {
ChunkRange prometheus.Histogram ChunkRange prometheus.Histogram
} }
func newCompactorMetrics(r prometheus.Registerer) *CompactorMetrics { // NewCompactorMetrics initializes metrics for Compactor.
func NewCompactorMetrics(r prometheus.Registerer) *CompactorMetrics {
m := &CompactorMetrics{} m := &CompactorMetrics{}
m.Ran = prometheus.NewCounter(prometheus.CounterOpts{ m.Ran = prometheus.NewCounter(prometheus.CounterOpts{
@ -203,7 +204,7 @@ func NewLeveledCompactorWithOptions(ctx context.Context, r prometheus.Registerer
ranges: ranges, ranges: ranges,
chunkPool: pool, chunkPool: pool,
logger: l, logger: l,
metrics: newCompactorMetrics(r), metrics: NewCompactorMetrics(r),
ctx: ctx, ctx: ctx,
maxBlockChunkSegmentSize: maxBlockChunkSegmentSize, maxBlockChunkSegmentSize: maxBlockChunkSegmentSize,
mergeFunc: mergeFunc, mergeFunc: mergeFunc,