# Prometheus scrape configuration for the Gurubase Siper organization metrics endpoint.
# Replace panel.example.com with your panel address. Put the metrics key (created in the
# panel under Settings > Monitoring) into the credentials file, readable only by Prometheus.
scrape_configs:
  - job_name: gurubase
    scheme: https
    metrics_path: /api/v1/metrics
    scrape_interval: 30s
    scrape_timeout: 10s
    authorization:
      type: Bearer
      credentials_file: /etc/prometheus/gurubase-metrics.key
    static_configs:
      - targets: ["panel.example.com"]

  # Optional: availability probes through blackbox_exporter (see blackbox.yml). They
  # check the real request path even when there is no traffic.
  - job_name: gurubase-health
    metrics_path: /probe
    params:
      module: [gurubase_health]
    static_configs:
      - targets: ["https://api.example.com/health"]
    relabel_configs: &blackbox_relabel
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: blackbox-exporter:9115

  - job_name: gurubase-mask-probe
    metrics_path: /probe
    scrape_interval: 60s
    params:
      module: [gurubase_mask]
    static_configs:
      - targets: ["https://api.example.com/mask"]
    relabel_configs: *blackbox_relabel

rule_files:
  - /etc/prometheus/rules/gurubase-alerts.yml
