I need to store Prometheus metrics with different retention time to decrease DB size. how can I solve it?
I need to store Prometheus metrics with different retention time to decrease DB size. how can I solve it?
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.
PS. If you need reducing storage space usage, then take a look at VictoriaMetrics. It may reduce storage space usage by up to 7x comparing to Prometheus. See this post for details. (I'm the creator of VictoriaMetrics)