分布式监控解决方案

Prometheus Grafana AlertManager

监控指标配置

# prometheus.yml
scrape_configs:
  - job_name: 'node'
    static_configs:
      - targets: ['node-exporter:9100']

  - job_name: 'spring'
    metrics_path: '/actuator/prometheus'
    static_configs:
      - targets: ['app:8080']

# 报警规则
groups:
- name: instance-down
  rules:
  - alert: InstanceDown
    expr: up == 0
    for: 5m