/ opencodehub / deploy / prometheus.yml
Swadhin Biswas Feature/ai code reviewer (#73) · 8/2/2026
105a287
41 lines · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Prometheus scrape configuration for OpenCodeHub
# Add this to your prometheus.yml or include as a file

scrape_configs:
  - job_name: "opencodehub"
    metrics_path: "/api/metrics"
    scrape_interval: 15s
    scrape_timeout: 10s
    # /api/metrics is protected by METRICS_TOKEN when set. Provide the token
    # via environment expansion, e.g. start prometheus with:
    #   METRICS_TOKEN=<value> prometheus --config.file=prometheus.yml
    # or mount a file containing the token at /etc/prometheus/och-metrics-token
    authorization:
      credentials_file: /etc/prometheus/och-metrics-token
    static_configs:
      - targets: ["opencodehub-app:4321"]
        labels:
          service: "opencodehub"
          environment: "production"

  - job_name: "opencodehub-worker"
    # Worker exposes metrics on port 9090
    metrics_path: "/metrics"
    scrape_interval: 15s
    scrape_timeout: 10s
    static_configs:
      - targets: ["opencodehub-worker:9090"]
        labels:
          service: "opencodehub-worker"
          environment: "production"

  - job_name: "postgres"
    # Requires postgres_exporter sidecar
    static_configs:
      - targets: ["postgres-exporter:9187"]

  - job_name: "redis"
    # Requires redis_exporter sidecar
    static_configs:
      - targets: ["redis-exporter:9121"]