Prometheus 普罗米修斯规则错误
我试图让prometheus警报启动并运行,但在定义警报时,它总是告诉我语法错误 我用来启动普罗米修斯的命令Prometheus 普罗米修斯规则错误,prometheus,Prometheus,我试图让prometheus警报启动并运行,但在定义警报时,它总是告诉我语法错误 我用来启动普罗米修斯的命令 ./prometheus -config.file=prometheus.yml -alertmanager.url http://localhost:9093 这是我得到的错误 prometheus, version 0.15.1 (branch: master, revision: 64349aa) build user: julius@julius-thinkpa
./prometheus -config.file=prometheus.yml -alertmanager.url http://localhost:9093
这是我得到的错误
prometheus, version 0.15.1 (branch: master, revision: 64349aa)
build user: julius@julius-thinkpad
build date: 20150727-17:56:51
go version: 1.4.2
INFO[0000] Loading configuration file prometheus.yml file=main.go line=173
ERRO[0000] Error loading rules, previous rule set restored: error parsing /home/ubuntu/alert.rules: Parse error at line 4, char 4: alert summary missing file=manager.go line=348
这是alert.rule文件
ALERT node_down
IF up == 0
FOR 5m
LABELS {
severity="critical"
}
ANNOTATIONS {
summary = "Instance {{$labels.instance}} down",
description = "{{$labels.instance}} of job {{$labels.job}} has been down for more than 5 minutes."
}
这是我的prometheus.yml文件
global:
scrape_interval: 15s
evaluation_interval: 15s
'evaluation_interval'.
rule_files:
- "/home/ubuntu/alert.rules"
scrape_configs:
- job_name: 'prometheus'
target_groups:
- targets: ['localhost:9100','xxx.xxx.xxx.xxx:9100']
这是普罗米修斯(Prometheus)的一个相当古老的版本,它在警报方面的语法略有不同。请尝试更新版本。这就是问题所在!非常感谢你。我使用的是0.15版(我不知道为什么)。一个有效的是1.5查看警报规则的正确格式是什么?( )