mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-04 20:06:12 +02:00
tsdb: Introduced new constructor for LeveledCompactor to take in metrics (#16408)
* Introduced new constructor for LeveledCompactor to take in metrics Signed-off-by: Alex Le <leqiyue@amazon.com> * Added Metrics to LeveledCompactorOptions Signed-off-by: Alex Le <leqiyue@amazon.com> --------- Signed-off-by: Alex Le <leqiyue@amazon.com>
This commit is contained in:
parent
2aaafae36f
commit
bce72b93d9
@ -169,6 +169,8 @@ type LeveledCompactorOptions struct {
|
||||
// EnableOverlappingCompaction enables compaction of overlapping blocks. In Prometheus it is always enabled.
|
||||
// It is useful for downstream projects like Mimir, Cortex, Thanos where they have a separate component that does compaction.
|
||||
EnableOverlappingCompaction bool
|
||||
// Metrics is set of metrics for Compactor. By default, NewCompactorMetrics would be called to initialize metrics unless it is provided.
|
||||
Metrics *CompactorMetrics
|
||||
}
|
||||
|
||||
type PostingsDecoderFactory func(meta *BlockMeta) index.PostingsDecoder
|
||||
@ -214,11 +216,14 @@ func NewLeveledCompactorWithOptions(ctx context.Context, r prometheus.Registerer
|
||||
if pe == nil {
|
||||
pe = index.EncodePostingsRaw
|
||||
}
|
||||
if opts.Metrics == nil {
|
||||
opts.Metrics = NewCompactorMetrics(r)
|
||||
}
|
||||
return &LeveledCompactor{
|
||||
ranges: ranges,
|
||||
chunkPool: pool,
|
||||
logger: l,
|
||||
metrics: NewCompactorMetrics(r),
|
||||
metrics: opts.Metrics,
|
||||
ctx: ctx,
|
||||
maxBlockChunkSegmentSize: maxBlockChunkSegmentSize,
|
||||
mergeFunc: mergeFunc,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user