+1 (855) 920-2583
Login

How long does Prometheus stored its data

Modified on: Fri, 17 Nov 2023 1:14 PM
Original Publishing Date:
2023-05-30

Question

Prometheus scraped data from some exposed metrics of some applications, but how long does it store it or how long is the data retention?


Answer

It depends on the value configured on paramenter storage.tsdb.retention.time on  prometheus-prometheus-operator-kube-p-prometheus-0.


For example as below, it is 10 days:


[root@~]# kubectl describe pod prometheus-prometheus-operator-kube-p-prometheus-0 -n infrastructure | grep tsdb                                                                                                                                                           
      --storage.tsdb.path=/prometheus                                                               --storage.tsdb.retention.time=10d                                                             --storage.tsdb.no-lockfile                                                                                                             


Internal