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

相关推荐
Yang三少喜欢撸铁1 天前
通过Docker部署Prometheus + Grafana搭建监控平台【超详细版】
linux·服务器·docker·容器·grafana·prometheus
liuyunshengsir3 天前
Gin 集成 prometheus 客户端实现注册和暴露指标
prometheus·gin
小黑_深呼吸4 天前
k8s平台:手动部署Grafana
运维·学习·kubernetes·grafana·prometheus
阿桨4 天前
【Prometheus-OracleDB Exporter安装配置指南,开机自启】
数据库·oracle·centos·prometheus
川石教育4 天前
Prometheus使用Recoding Rules优化性能
prometheus·普罗米修斯·普罗修斯监控
yunson_Liu4 天前
prometheus手动添加k8s集群外的node-exporter监控
容器·kubernetes·prometheus
阿桨4 天前
【Prometheus-Mongodb Exporter安装配置指南,开机自启】
数据库·mongodb·prometheus
小马爱打代码5 天前
Spring Boot × K8s 监控实战-集成 Prometheus 与 Grafana
spring boot·kubernetes·prometheus
yunson_Liu5 天前
prometheus通过Endpoints自定义grafana的dashboard模块
贪心算法·grafana·prometheus
闫利朋7 天前
【基础篇】prometheus页面UI功能详解
prometheus