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 表示生效

相关推荐
cui_win19 小时前
Prometheus实战教程 - mysql监控
mysql·prometheus·压测
nVisual1 天前
Prometheus连接nVisual实现资产拓扑业务关联分析
prometheus
Swift社区2 天前
数据库连接池监控最佳实践:用 Prometheus + Grafana 打造可视化监控体系
数据库·grafana·prometheus
yunson_Liu3 天前
grafana限制folder普通用户访问
grafana·prometheus
技术破壁人3 天前
《Prometheus + Grafana 监控体系实战》—— 从指标采集到智能告警!
grafana·prometheus
soft20015253 天前
Rocky Linux 9.6 环境下,Prometheus + Grafana 生产级安装手册
linux·grafana·prometheus
广目软件3 天前
GM DC Monitor一体化监控预警平台部署手册2025-12-10
运维·自动化·ansible·zabbix·运维开发·prometheus
Live in Shanxi.3 天前
Prometheus监控服务器及K8s集群资源
服务器·kubernetes·prometheus
联系QQ19226384 天前
COMSOL文献复现:手性结构通用模型的透射反射率计算
prometheus
星哥说事4 天前
Prometheus:监控系统的部署与指标收集
prometheus