global:
  scrape_interval: 15s
  evaluation_interval: 15s

# 告警规则文件
rule_files:
  - /etc/prometheus/rules.yml

# 告警管理器
alerting:
  alertmanagers:
    - static_configs:
        - targets:
            - edu-alertmanager:9093

scrape_configs:
  # ============================================================
  # 应用服务（NestJS / FastAPI 暴露 /metrics）
  # classes 已合并入 core-edu（P3 裁决 C1），3001 端口已废弃
  # ============================================================
  - job_name: 'iam-service'
    static_configs:
      - targets: ['host.docker.internal:3002']
        labels:
          service: iam

  - job_name: 'teacher-bff'
    static_configs:
      - targets: ['host.docker.internal:3003']
        labels:
          service: teacher-bff

  - job_name: 'core-edu-service'
    static_configs:
      - targets: ['host.docker.internal:3004']
        labels:
          service: core-edu

  - job_name: 'content-service'
    static_configs:
      - targets: ['host.docker.internal:3005']
        labels:
          service: content

  - job_name: 'data-ana-service'
    static_configs:
      - targets: ['host.docker.internal:3006']
        labels:
          service: data-ana

  - job_name: 'msg-service'
    static_configs:
      - targets: ['host.docker.internal:3007']
        labels:
          service: msg

  - job_name: 'ai-service'
    static_configs:
      - targets: ['host.docker.internal:3008']
        labels:
          service: ai

  # ============================================================
  # 基础设施（docker-compose.minimal/minimal.override）
  # ============================================================
  - job_name: 'mysql'
    static_configs:
      - targets: ['host.docker.internal:9104']
        labels:
          service: mysql

  - job_name: 'redis'
    static_configs:
      - targets: ['host.docker.internal:9121']
        labels:
          service: redis

  # ============================================================
  # 监控栈自身
  # ============================================================
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'node-exporter'
    static_configs:
      - targets: ['host.docker.internal:9100']
        labels:
          service: node-exporter
