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

相关推荐
川石课堂软件测试44 分钟前
自动化测试之 Cucumber 工具
数据库·功能测试·网络协议·测试工具·mysql·单元测试·prometheus
K_i1341 小时前
负载均衡:运维高可用的核心技术
负载均衡·grafana·prometheus
爱技术的小伙子6 小时前
【Linux运维】 Prometheus + Grafana + Alertmanager 监控系统部署指南(CentOS & Ubuntu 通用版)
linux·运维·prometheus
川石课堂软件测试16 小时前
MySQL数据库之DBA命令
数据库·网络协议·mysql·http·单元测试·prometheus·dba
神秘人X7071 天前
Docker监控:cAdvisor+Prometheus+Grafana实战指南
docker·grafana·prometheus
有谁看见我的剑了?1 天前
Prometheus pushgateway学习
学习·prometheus
维尔切2 天前
Docker 监控平台部署
运维·docker·容器·grafana·prometheus
半梦半醒*2 天前
Prometheus监控物理服务器
linux·运维·服务器·centos·prometheus
K_i1343 天前
普罗米修斯监控实战:从原理到小型项目
prometheus