prometheus

How to store data in prometheus with different retention time per job or targets?


I need to store Prometheus metrics with different retention time to decrease DB size. how can I solve it?


Solution

  • Prometheus doesn't support multiple retention policies - only a single retention can be configured for all the stored data. If you need distinct retentions per job, then the easiest solution would be to run multiple Prometheus instances with distinct scrape configs and distinct retention periods. These Prometheus instances can be queried sumiltaneusly via Promxy in order to get global querying view.