prometheus,2.7.2版(分支:标题,修订: 82f98c8) 构建用户: root@ab86c672c33a 建造日期: 20190302-14:57:04 go版本: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}}但我可以在网上看到任何规则。
http://192.168.0.10:9090/alerts
我得到了“没有警告规则的定义”
http://192.168.0.10:9090/rules
我得到“没有规则的定义”
在警报管理器web中
http://192.168.0.238:9093/#/alerts
我得到“没有发现警报”
发布于 2019-05-17 02:06:30
值:{{$value}}必须是值:“{$value}}”
https://stackoverflow.com/questions/55153361
复制相似问题