Prometheus 保留时间设置为 1 年,但保留数据的时间不会超出默认值 15 天

Sio*_*ion 1 prometheus prometheus-operator prometheus-blackbox-exporter

我最近安装了 Prometheus 并使用 Grafana 进行报告。

我在安装过程中将 Prometheus 设置为保留时间为 1 年:

--storage.tsdb.retention.time=1y
Run Code Online (Sandbox Code Playgroud)

现在,我们从昨天开始注意到 15 天前的数据不再显示。我的代码有问题吗?是1y不是不被认可?

Bor*_*nov 5

您需要在启动文件(fe prometheus.service)中设置命令行选项

--storage.tsdb.retention.size 120GB \                                                                                                                                                                                                     
--storage.tsdb.retention.time 1825d
Run Code Online (Sandbox Code Playgroud)

在此示例中,我设置 120 GB 作为存储空间,5 年作为保存数据的时间范围