prometheus执行reload命令失败

prometheus对于yml文件的格式校验十分严格

groups:
- name: PromRules
  rules:
  - alert: Node-Load
    annotations: {description: 'descTest',
      summary: 'summaryTest'}
    expr: node_load1 > 0.01
    for: 30s
    labels: {resType: 'Node',severity: 'warning'}
  - alert: Node-Load
    annotations: {description: 'descTest',
      summary: 'summaryTest'}
    expr: node_load1 > 0.02
    for: 30s
    labels: {resType: 'Node',severity: 'critical'}
  - alert: Node-Load
    annotations: {description: 'descTest',
      summary: 'summaryTest'}
    expr: node_load1 > 0.05
    for: 30s
    labels: {resType: 'Node',severity: 'emergency'}

以上面这个yml文件为例,不能包含tab自不必说,且 - alert: 必须完全对齐,哪怕多一个空格,也会造成yml文件读取失败

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页