Prometheus修改默认数据存储时间

Prometheus的默认数据存储时间可以通过修改启动脚本中的相关参数来调整。具体来说,可以通过修改--storage.tsdb.retention.time参数来改变数据保留的时长。该参数决定了何时删除旧数据,默认为15天。如果需要延长数据保留时间,可以将该参数的值设置为更大的天数,

例如:--storage.tsdb.retention.time=365d会将保留时间设置为一年。

启动命令修改为如下:

bash 复制代码
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 表示生效

相关推荐
Crayon Lin3 小时前
Prometheus
prometheus
川石课堂软件测试2 天前
JMeter异步接口测试实战
数据库·python·jmeter·mysql·kubernetes·测试用例·prometheus
lbb 小魔仙5 天前
Redis运行状态总靠手动查?我用redis_exporter+Prometheus把指标、告警和远程抓取全接起来了
redis·bootstrap·prometheus
程序员-Benothing5 天前
Linux系统监控工具全家桶:sar、dstat、glances、Prometheus
linux·运维·prometheus
wzq11_6665 天前
Prometheus监控——云原生与非云原生监控
云原生·prometheus
东风微鸣6 天前
把 Tailscale 接进 Prometheus 监控
java·数据库·prometheus
Kendra9196 天前
运维监控平台(Prometheus + Grafana)部署与维护
运维·grafana·prometheus
Dovis(誓平步青云)6 天前
一年1956亿行:智能电表场景下的时序数据存储实践
运维·前端·自动化·音视频·prometheus
空空dream7 天前
06 | Prometheus打通FastAPI云原生数据采集
云原生·prometheus·fastapi
Dovis(誓平步青云)8 天前
常用命令藏得太深?怎么做一个快捷命令坞
运维·前端·自动化·音视频·prometheus