Skip to content

feat(compactor-hs): add a metric to track the number of jobs left to conclude ongoing unit of work - #19506

Merged
sandeepsukhani merged 2 commits into
mainfrom
hs-compactor-jobs-left-tracker
Oct 15, 2025
Merged

feat(compactor-hs): add a metric to track the number of jobs left to conclude ongoing unit of work#19506
sandeepsukhani merged 2 commits into
mainfrom
hs-compactor-jobs-left-tracker

Conversation

@sandeepsukhani

@sandeepsukhani sandeepsukhani commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
I am working on adding autoscaling support to compactor workers. To estimate the number of replicas required to perform the ongoing work, I have added a metric to track the estimated number of jobs left to be processed.

Since compactor processes only one segment at a time, we will estimate the deletion job count and track it in the metric only for the segment currently being processed. If we count all the jobs that would be created for the entire deletion manifest and autoscale on that, we would have some workers running idle.

Checklist

  • Tests updated
@sandeepsukhani
sandeepsukhani requested a review from a team as a code owner October 15, 2025 13:20
@sandeepsukhani
sandeepsukhani merged commit 9e0f50c into main Oct 15, 2025
64 checks passed
@sandeepsukhani
sandeepsukhani deleted the hs-compactor-jobs-left-tracker branch October 15, 2025 13:40
felix0102 pushed a commit to felix0102/loki that referenced this pull request Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants