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

相关推荐
川石课堂软件测试5 小时前
Oracle 数据库:视图与索引
数据库·网络协议·nginx·http·oracle·grafana·prometheus
川石课堂软件测试13 小时前
Oracle 数据库如何查询列
linux·数据库·sql·功能测试·oracle·grafana·prometheus
川石课堂软件测试17 小时前
Oracle 数据库使用事务确保数据的安全
数据库·python·功能测试·docker·oracle·单元测试·prometheus
文人sec4 天前
性能测试-jmeter7-元件提取器
python·jmeter·prometheus·模块测试
❀͜͡傀儡师5 天前
docker安装Prometheus和Grafana 监控界面
docker·grafana·prometheus
夏目&贵志6 天前
prometheus+grafana监控系统
docker·grafana·prometheus
强_子7 天前
基于 Prometheus+Alertmanager+Grafana 打造监控报警后台(四)-Grafana告警配置
服务器·grafana·prometheus
Clownseven7 天前
Prometheus+Grafana入门教程:从零搭建云原生服务器监控系统
云原生·grafana·prometheus
鼠鼠我捏,要死了捏7 天前
基于Prometheus Pushgateway与Alertmanager的自定义指标监控与告警实践指南
prometheus·pushgateway
一腔热血10077 天前
prometheus alertmanager 对接飞书
数据库·飞书·prometheus