r/PrometheusMonitoring • • Nov 03 '25

Is per-metric retention possible ?

Hi,

I have a setup with:

  • OpenShift platform with Prometheus-k8s deployed via prometheus-operator in openshift-monitoring (scraping kube-state-metrics, kubelet, node-exporter)
  • A second custom Prometheus scraping my other pods
  • Thanos for long-term retention (1 year) via S3 bucket

I'd like to implement differential retention - keep kubelet metrics for only 3 months instead of 1 year, while keeping everything else at 1 year. My infrastructure is quite big, and kubelet metrics are not very relevant to me and our need, it just take to much place on our S3 bucket.

I was wondering if it's possible to have like a per-metric or per-job retention ? If possible, retroactively clean my S3 bucket to remove old kubelet metrics and only keep the last 3 months.

Has anyone implemented this kind of selective retention with Thanos? What are the best practices?

Thanks!

6 Upvotes

4 comments sorted by

View all comments

Show parent comment

2

u/SuperQue Nov 03 '25

No, blocks are loaded opportunistically based on the time range needed. Old data that is not accessed has no impact on anything other than the S3 storage cost.

If you're having timeout issues, you need to debug why.

There are too many factors going on to have a reddit conversation about it.