给大家推荐一个收集 Prometheus 各种报警规则的项目,该网站收集了 Prometheus 各种报警规则的项目,都是比较通用的报警规则配置。并且网站还提供了每款软件的exporter。

基本覆盖了我们常用软件的报警规则和exporter,非常有参考和学习的价值。

  • Prometheus
  • Host
  • Docker containers
  • Nginx
  • RabbitMQ
  • MySQL
  • PostgreSQL
  • Redis
  • MongoDB
  • Elasticsearch
  • Apache
  • HaProxy
  • Traefik v1.*
  • PHP-FPM
  • Java
  • ZFS
  • Kubernetes
  • Nomad
  • Consul
  • Etcd
  • Zookeeper
  • Kafka
  • Linkerd
  • Istio
  • Blackbox
  • Windows Server
  • OpenEBS
  • Minio
  • Juniper
  • CoreDNS

AlertManager configuration

# alertmanager.yml
route:
# When a new group of alerts is created by an incoming alert, wait at
# least 'group_wait' to send the initial notification.
# This way ensures that you get multiple alerts for the same group that start
# firing shortly after another are batched together on the first
# notification.
group_wait: 10s
# When the first notification was sent, wait 'group_interval' to send a betch
# of new alerts that started firing for that group.
group_interval: 5m
# If an alert has successfully been sent, wait 'repeat_interval' to
# resend them.
repeat_interval: 30m
# A default receiver
receiver: "slack"
# All the above attributes are inherited by all child routes and can
# overwritten on each.
routes:
- receiver: "slack"
group_wait: 10s
match_re:
severity: error|warning
continue: true
- receiver: "sms"
group_wait: 10s
match_re:
severity: error
continue: true
receivers:
- name: "slack"
slack_configs:
- api_url: 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/xxxxxxxxxxxxxxxxxxxxxxxxxxx'
send_resolved: true
channel: 'monitoring'
text: "{{ range .Alerts }}<!channel> {{ .Annotations.summary }}\n{{ .Annotations.description }}\n{{ end }}"
- name: "sms"
webhook_config:
- url: http://a.b.c:8080/send/sms
send_resolved: true


官网地址:​https://awesome-prometheus-alerts.grep.to​