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