# Prometheus 通用模板(建议通过 scripts/discover-targets.py 生成运行时配置)
#
# 正式一键启动入口:
#   ./launch.sh
# 运行时会覆盖为:
#   generated/prometheus.yml
#
# 模板用途:
#   - 作为本地调试与配置说明参考
#   - 说明 Coordinator / Engine 的标准 scrape 约定

global:
  scrape_interval: 5s
  evaluation_interval: 15s
  metric_name_validation_scheme: utf8
  external_labels:
    monitor: motor-observability

scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets:
          - "localhost:9090"

  # Coordinator observability / typed metrics
  - job_name: motor-coordinator
    metrics_path: /metrics
    static_configs:
      - targets:
          - "host.docker.internal:1027"
        labels:
          motor_component: coordinator
          motor_metric_scope: full
          cluster: example-namespace

  - job_name: motor-coordinator-instance
    metrics_path: /metrics?type=instance
    static_configs:
      - targets:
          - "host.docker.internal:1027"
        labels:
          motor_component: coordinator
          motor_metric_scope: instance
          cluster: example-namespace

  - job_name: motor-coordinator-role-prefill
    metrics_path: /metrics?type=role&role=prefill
    static_configs:
      - targets:
          - "host.docker.internal:1027"
        labels:
          motor_component: coordinator
          motor_metric_scope: role
          role: prefill
          pd_role: prefill
          cluster: example-namespace

  - job_name: motor-coordinator-role-decode
    metrics_path: /metrics?type=role&role=decode
    static_configs:
      - targets:
          - "host.docker.internal:1027"
        labels:
          motor_component: coordinator
          motor_metric_scope: role
          role: decode
          pd_role: decode
          cluster: example-namespace

  # Engine management metrics(honor_labels 打开,保留应用侧标签)
  - job_name: motor-engine
    metrics_path: /metrics
    honor_labels: true
    static_configs:
      - targets:
          - "host.docker.internal:10001"
        labels:
          motor_component: engine
          pd_role: prefill
          role: prefill
          instance_id: p0
          cluster: example-namespace
      - targets:
          - "host.docker.internal:10001"
        labels:
          motor_component: engine
          pd_role: prefill
          role: prefill
          instance_id: p1
          cluster: example-namespace
      - targets:
          - "host.docker.internal:10001"
        labels:
          motor_component: engine
          pd_role: decode
          role: decode
          instance_id: d0
          cluster: example-namespace

  # vLLM Profiling(来自 ms_service_metric 的 vllm_profiling_*)
  - job_name: vllm-profiling
    metrics_path: /metrics
    honor_labels: true
    static_configs:
      - targets:
          - "host.docker.internal:10001"
        labels:
          motor_component: vllm
          cluster: example-namespace

  # Docker Compose 基础 exporter
  - job_name: node-exporter
    static_configs:
      - targets:
          - "node-exporter:9100"

  - job_name: cadvisor
    static_configs:
      - targets:
          - "cadvisor:8080"