How to Prevent TiDB's Prometheus from Automatically Reloading Configuration Files

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb的prometheus总是会自动重加载配置文件,如何避免让它自己重加载

| username: 特雷西-迈克-格雷迪

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed that led to the issue
[Encountered Issue: Problem Phenomenon and Impact]

Prometheus modifies tidb.rules.yml, but the values are always reloaded and overwritten. How can I permanently modify the alert thresholds inside?

[Resource Configuration]

| username: DBAER | Original post link

Refer to this? 自定义监控组件的配置 | PingCAP 文档中心

| username: 像风一样的男子 | Original post link

You need to customize the Prometheus rule, otherwise, it will be overwritten by the default configuration every time you restart or reload.

Place the custom rule configuration file in a directory on the specified machine.
Use tiup cluster edit-config ${cluster-name} to modify the cluster configuration.

monitoring_servers:
  - host: 127.0.0.1
    rule_dir: /home/tidb/prometheus_rule   # prometheus rule dir on TiUP machine

After the above configuration, during the cluster reload operation, TiUP will read the custom rule from the local path /home/tidb/prometheus_rule and then send this configuration to the Prometheus Server, replacing the default configuration rules.

| username: 呢莫不爱吃鱼 | Original post link

Mark, take a look.

| username: shunzi | Original post link

Learned.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.