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

相关推荐
梁正雄1 天前
6、prometheus资源规划
运维·服务器·服务发现·prometheus·监控
梁正雄2 天前
4、prometheus-服务发现k8s api-2
kubernetes·服务发现·prometheus
麦兜*5 天前
Spring Boot 应用 Docker 监控:Prometheus + Grafana 全方位监控
spring boot·后端·spring cloud·docker·prometheus
罗不俷7 天前
Prometheus 详解:从原理到实战,打造企业级云原生监控体系
云原生·prometheus
Deamon Tree8 天前
Prometheus和Grafana简介
grafana·prometheus
码界奇点9 天前
Apache IoTDB 架构特性与 PrometheusGrafana 监控体系部署实践
架构·apache·grafana·prometheus·iotdb
Linux-palpitate9 天前
基于Prometheus和Grafana的MySQL监控,服务器监控
服务器·grafana·prometheus
hello_25010 天前
golang程序对接prometheus
开发语言·golang·prometheus
angushine11 天前
Docker方式安装Prometheus+Grafana+Node Exporter
docker·grafana·prometheus
SRETalk12 天前
夜莺监控设计思考(三)时序库、agent 的一些设计考量
prometheus·可观测性·监控告警·nightingale·opentelemetry·夜莺监控·categraf