prometheus,版本2.7.2(分支:HEAD,修订版:82f98c8)
构建用户:root @ ab86c672c33a
建立日期:20190302-14:57:04
转到版本:go1.11.5
泊坞窗中的所有程序。
prometheus.yml
# my global config
global:
scrape_interval: 10s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 10s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets: ['192.168.0.238:9093']
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
- "/docker/prometheus/sd_config/alert_rules/alertmanager_rules.yml"
alertmanager_rules.yml
groups:
- name: alert-name
rules:
- alert: InstanceDown # 告警名称
expr: up == 0 # 告警的判定条件,参考Prometheus高级查询来设定
for: 2m # 满足告警条件持续时间多久后,才会发送告警
labels: #标签项
team: node
annotations: # 解析项,详细解释告警信息
summary: "{{$labels.instance}}: has been down"
description: "{{$labels.instance}}: job {{$labels.job}} has been down "
value: {{$value}}
prometheus config
alertmanager_rules file
但是我可以在网上看到任何规则。
http://192.168.0.10:9090/alerts
我收到“未定义警报规则”
web alert image
http://192.168.0.10:9090/rules
我收到“未定义规则”
web rules image
在alertmanager网站
http://192.168.0.238:9093/#/alerts
我收到“未找到警报”
答案 0 :(得分:0)
值:{{$ value}}必须是值:“ {{$ value}}”