# 该 prometheus 配置文件适用于监控多个目标
global:
  scrape_interval: 15s # 抓取间隔
  scrape_timeout: 10s # 抓取超时时间
  evaluation_interval: 15s # 规则评估间隔
  external_labels:
    monitor: 'prometheus'

# 需要监控的目标列表
scrape_configs:
  # 监控自身指标
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
  # 监控 node-exporter 暴露的指标
  - job_name: 'node-exporter'
    static_configs:
      - targets: ['node1:9100', 'node2:9100']
  # 监控 blackbox-exporter 暴露的指标
  - job_name: 'http-endpoints'
    metrics_path: /probe
    params:
      module: [http_2xx]
    static_configs:
      - targets:
          - http://example.com
          - https://example.com