首页 > 解决方案 > Prometheus 保留时间设置为 1 年,但不会将数据保留超过默认 15 天

问题描述

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

在安装过程中设置了 Prometheus,保留时间为 1 年 --storage.tsdb.retention.time=1y \

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

标签: prometheusprometheus-operatorprometheus-blackbox-exporter

解决方案


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

--storage.tsdb.retention.size 120GB \                                                                                                                                                                                                     
--storage.tsdb.retention.time 1825d

在这个例子中,我设置了 120 GB 作为存储空间和 5 年作为保存数据的时间范围


推荐阅读