# =============================================================================
# Prometheus 配置 - Kong API Gateway + RWA Services 监控
# =============================================================================

global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  # Kong Prometheus 指标端点
  - job_name: 'kong'
    static_configs:
      - targets: ['kong:8001']
    metrics_path: /metrics

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

  # ==========================================================================
  # RWA Presence Service - 用户活跃度与在线状态监控
  # ==========================================================================
  - job_name: 'presence-service'
    static_configs:
      # 生产环境: 使用内网 IP 或 Docker 网络名称
      # - targets: ['presence-service:3011']
      # 开发环境: 使用 host.docker.internal 访问宿主机服务
      - targets: ['host.docker.internal:3011']
    metrics_path: /api/v1/metrics
    scrape_interval: 15s
    scrape_timeout: 10s
    # 添加标签便于区分
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
        replacement: 'presence-service'
