【问题标题】:What should be the correct rule to specify in alert_rules.yml file in prometheus在 prometheus 的 alert_rules.yml 文件中指定的正确规则应该是什么
【发布时间】:2020-12-29 16:58:01
【问题描述】:

下面是我目前使用的 yam 文件。

groups:
 - name: alertname
   rules:
   - alert: InstanceDown
     expr: up == 0
     for: 1m

下面是我通过 Prometheus 中的 prom 工具后得到的错误。

Checking alert_rules.yml
  FAILED: unknown fields in config: groups

我无法找到任何解决方案,因为我在 Internet 上进行了检查,并且它显示了一个有效的 yml 文件。

【问题讨论】:

    标签: linux yaml alert prometheus yaml-cpp


    【解决方案1】:

    您正在使用 Prometheus 配置文件中的“rule_file”子句加载 alert_rules.yml 文件,对吧?

    如果是,请参阅this answer

    【讨论】:

      猜你喜欢
      • 2011-06-18
      • 2021-06-23
      • 1970-01-01
      • 1970-01-01
      • 2016-06-23
      • 2017-03-27
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      相关资源
      最近更新 更多