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年了。

相关推荐
阿明61 小时前
Linux进程【Linux】
linux·运维·服务器
Android系统攻城狮1 小时前
Linux Gstreamer深度解析之gst_audio_resampler_update调用流程与实战(三十)
linux·运维·服务器·gstreamer音视频·音视频进阶
微信ipad协议开发1 小时前
微信视频号自动化:内容发布与互动的 API 实现
运维·微信
天天喝旺仔1 小时前
分布式服务容错实战:用 Sentinel 实现限流、熔断与降级
分布式·微服务·云原生·sentinel
ggaofeng4 小时前
prometheus时序数据库
prometheus
蓝速科技4 小时前
会议室门牌签到功能选型与落地指南丨蓝速科技
大数据·运维·数据库·人工智能·科技
逐流人4 小时前
Containerd容器管理实战:从架构原理到nerdctlcrictl工具链
linux·运维·云原生·容器·云计算·containerd
酣大智7 小时前
网络协议计时器 & 发包间隔汇总
运维·网络·tcp/ip
云运维笔记14 小时前
IP地址从入门到精通:网络通信的核心基石
运维·网络·计算机网络
码农学院15 小时前
企业官网改版后 AI 引用归零的复盘:301 重定向断层让爬虫索引掉线,修复方案与恢复数据
运维·geo优化·ai优化aio