prometheus调整默认数据存储时间

调整kubernetes部署的prometheus数据存储时间

由于prometheus是用kuberentes部署的,没办法像传统部署方式那种直接在启动参数增加存储时间的参数。需要在configmap里或者在deployment里添加,我这里使用的方式是在deployement里添加调整存储时间的参数。

yaml 复制代码
执行kubectl -n prometheus edit deployment prometheus命令直接修改deployement文件
添加如下参数:

spec:
  containers:
  - args:
    - --storage.tsdb.retention.time=365d
    - --config.file=/etc/prometheus/prometheus.yml  # 需要指定配置文件的位置,不然会到当前目录下寻找prometheus.yml文件

添加完参数以后,登录prometheus页面查看prometheus的状态信息,可以看到存储的时间已经变成1年了。

相关推荐
xingyuzhisuan6 小时前
网络 Token 常见故障原理,基础排查科普
运维·服务器·网络·php
APIshop7 小时前
Python 获取 1688 商品采集 API 接口 | 工厂货源自动化对接商品信息 | 无需选品
运维·python·自动化
wljy17 小时前
二、进制状态转换
linux·运维·服务器·c语言·c++
handler017 小时前
【MySQL】常用命令总结(库与表增删查改)
运维·数据库·mysql·命令·总结
week@eight7 小时前
Linux - Doris
linux·运维·数据库·mysql
看到代码头都是大的8 小时前
CentOS环境下手动升级openssl、openssh
linux·运维·centos
浮生若城8 小时前
Linux——Ext系列文件系统
linux·运维·服务器
ITyunwei09878 小时前
主流 SaaS 工单系统对比
运维·服务器·人工智能
weixin_548444268 小时前
爆红处理APK 自动化编译流水线 v2026(英文名:APK AutoPipeline)
运维·自动化
枳实-叶8 小时前
【Linux驱动开发】第16天:按键中断完整实战
linux·运维·驱动开发