Prometheus的默认数据存储时间可以通过修改启动脚本中的相关参数来调整。具体来说,可以通过修改--storage.tsdb.retention.time参数来改变数据保留的时长。该参数决定了何时删除旧数据,默认为15天。如果需要延长数据保留时间,可以将该参数的值设置为更大的天数,
 例如:--storage.tsdb.retention.time=365d会将保留时间设置为一年。
启动命令修改为如下:
nohup ./prometheus --config.file=prometheus.yml --web.enable-lifecycle 
--storage.tsdb.retention.time=365d > prometheus.log 2>&1 &
重启Prometheus;
通过http://ip:9090访问Prometheus查看是否生效
 Storage retention 等于:1y 表示生效
 
 



















