小编Faj*_*nto的帖子

测试规则 AlertManager 失败:yaml:解组错误:第 1 行:在类型 main.unitTestFile 中找不到字段组

请帮助我在下面测试警报管理器时收到错误消息

 promtool check rules /etc/prometheus/alert.rules.yml
 Checking /etc/prometheus/alert.rules.yml
 SUCCESS: 3 rules found

 promtool test rules /etc/prometheus/alert.rules.yml
 Unit Testing:  /etc/prometheus/alert.rules.yml
 FAILED:
 yaml: unmarshal errors:
 line 1: field groups not found in type main.unitTestFile
Run Code Online (Sandbox Code Playgroud)

我的alert.rules配置如下:

      cat /etc/prometheus/alert.rules.yml
      groups:
      - alert: MemoryFree10%
        expr: node_exporter:node_memory_free:memory_used_percents >= 90
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "Instance {{ $labels.instance }} hight memory usage"
          description: "{{ $labels.instance }} has more than 90% of its memory used."
      - alert: DiskSpace10%Free
        expr: node_exporter:node_filesystem_free:fs_used_percents >= 90
        labels:
          severity: …
Run Code Online (Sandbox Code Playgroud)

alert prometheus prometheus-alertmanager

5
推荐指数
1
解决办法
9119
查看次数