1
我試圖讓普羅米修斯警報啓動和運行,但定義警報時,它總是告訴我,語法是錯誤的普羅米修斯規則錯誤
命令我使用開始普羅米修斯
./prometheus -config.file=prometheus.yml -alertmanager.url http://localhost:9093
以下是錯誤,我得到
prometheus, version 0.15.1 (branch: master, revision: 64349aa)
build user: [email protected]
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']
這就是問題所在!非常感謝你。我使用的版本是0.15(我不知道爲什麼)。工作的那個人是1.5 –
請參閱什麼是警報規則的正確格式? (https://github.com/prometheus/docs/issues/907) –