# Prometheus Configuration for Agent OS
# 
# Scrapes metrics from:
# - Agent OS kernel (/metrics endpoint)
# - AlertManager
# - Prometheus itself

global:
  scrape_interval: 15s
  evaluation_interval: 15s
  external_labels:
    monitor: 'agent-os'

# Alertmanager configuration
alerting:
  alertmanagers:
    - static_configs:
        - targets:
          - alertmanager:9093

# Load rules once and periodically evaluate them
rule_files:
  - /etc/prometheus/rules/*.yaml

# Scrape configurations
scrape_configs:
  # Prometheus self-monitoring
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  # Agent OS Kernel metrics
  # Configure your Agent OS instances here
  - job_name: 'agent-os'
    static_configs:
      - targets: ['host.docker.internal:8080']  # Default Agent OS port
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
        regex: '(.+):\d+'
        replacement: '${1}'
    metrics_path: /metrics
    scheme: http

  # AlertManager metrics
  - job_name: 'alertmanager'
    static_configs:
      - targets: ['alertmanager:9093']

  # OTEL Collector metrics
  - job_name: 'otel-collector'
    static_configs:
      - targets: ['otel-collector:8888']

  # Example: Multiple Agent OS instances
  # - job_name: 'agent-os-production'
  #   static_configs:
  #     - targets:
  #       - 'agent-os-1.example.com:8080'
  #       - 'agent-os-2.example.com:8080'
  #   tls_config:
  #     insecure_skip_verify: false
  #   bearer_token_file: /etc/prometheus/bearer_token
