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

相关推荐
倔强的小石头_9 小时前
Ubuntu部署Prometheus与Alertmanager:systemd配置、告警对接及cpolar远程访问
数据库·ubuntu·prometheus
打工仔折腾 AI10 小时前
Prometheus接入Pushgateway实战:二进制与Docker部署、指标推送与远程写入
后端·python·docker·容器·性能优化·prometheus·ai agent 实战
Elastic 中国社区官方博客1 天前
两个依赖和一个配置块:通过 Prometheus 远程写入将 Spring Boot 指标发送到 Elasticsearch
大数据·数据库·spring boot·elasticsearch·搜索引擎·全文检索·prometheus
User_芊芊君子2 天前
Prometheus接入Pushgateway实战:二进制与Docker部署、指标推送及远程上报
docker·容器·prometheus
lbb 小魔仙8 天前
OpenClaw + cpolar 实战:远程 NAS、分享小游戏、RDP,再配置公网 AI 入口
数据库·人工智能·redis·oracle·prometheus
zhoupenghui1689 天前
Golang pprof 工具详解:监控、压测与调优实战指南
prometheus·pprof
ggaofeng10 天前
prometheus时序数据库
prometheus
A心有千千结14 天前
Nginx网关可观测建设:打通流量入口,加速线上故障诊断
nginx·prometheus·devops
天天喝旺仔14 天前
Prometheus + Grafana 监控告警体系搭建实战:从 Exporter 指标采集、PromQL 查询到 Alertmanager 告警落地
容器·kubernetes·grafana·prometheus·时序数据库
川石课堂软件测试18 天前
涨薪技术|Prometheus之HTTP API中使用PromQL
网络协议·测试工具·jmeter·http·单元测试·postman·prometheus