thanos
thanos copied to clipboard
feat(compact): Add Pushgateway metrics support for one-shot runs
- [x] I added CHANGELOG entry for this change.
- [ ] Change is not relevant to the end user.
Changes
This change introduces the ability for the thanos compact command to
push its metrics to a Prometheus Pushgateway when running in one-shot
mode (without the --wait flag).
This is particularly useful for monitoring the compactor when it is run as a periodic batch job, such as a cron job.
The following changes have been made:
- Refactored progress metric calculation to run in one-shot mode.
- Added
--push-gateway.urland--push-gateway.jobflags to configure the Pushgateway endpoint and job name. - Implemented the logic to push all registered metrics upon successful completion of a one-shot compaction run.
Verification
I've tested the metrics availability in the --wait mode and with a Pushgateway.
Added CHANGELOG entry.
Docs CI failure is unrelated, I've pushed a fix here: https://github.com/thanos-io/thanos/pull/8494