Skip to content

Health & Monitoring

Monitor Repod's operational status, integrate with your alerting stack, and interpret the health endpoints.


Health endpoints

Three endpoints are available for different monitoring scenarios. None of them needs authentication.

Endpoint Use case
GET /health/live Container liveness probe: is the process running?
GET /health/ready Readiness probe: are the critical dependencies ready?
GET /health Full status report, component by component

Liveness probe

curl http://localhost:8000/health/live
{"alive": true, "timestamp": "2026-11-09T15:35:04.064149+00:00"}

Returns 200 as long as the process answers. Use it for the Docker HEALTHCHECK and a Kubernetes livenessProbe.

Readiness probe

curl http://localhost:8000/health/ready
{"ready": true, "timestamp": "2026-11-09T15:38:24+00:00",
 "checks": {"manifests": {"ok": true, "free_gb": 18.1, "used_pct": 81.3}, "pool": {"ok": true}, "...": "..."}}

Returns 200 with "ready": true when the critical checks pass, and 503 when one fails (a full disk, an unreachable database). While the database migrations run at startup the server does not answer at all (connection refused), so a probe sees a failure either way. Use it for a Kubernetes readinessProbe and for load-balancer health checks.

Full health report

curl -s http://localhost:8000/health | jq .
{
  "status": "healthy",
  "timestamp": "2026-11-09T15:38:24+00:00",
  "version": "v1.0.0",
  "checks": {
    "critical":     {"manifests": {"ok": true}, "pool": {"ok": true}, "auth_db": {"ok": true}, "manifest_db": {"ok": true}},
    "non_critical": {"audit": {}, "clamav": {}, "reprepro": {}, "gpg": {}, "scheduler": {}, "alembic": {}},
    "info":         {"packages": {}, "storage": {}, "license": {}, "setup": {}, "ha": {}, "cache_backend": {}}
  }
}

status is healthy, degraded (a non-critical check failed, for example ClamAV still loading its signatures, or the disk holding /repos is 75 % full or more) or unhealthy (a critical check failed). Read the component you care about with, for instance, jq '.checks.non_critical.clamav'.


Docker health check configuration

The backend image defines its own health check (in backend/Dockerfile). It uses Python, because the image has no curl:

backend/Dockerfile (excerpt)
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
    CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health/live')" \
    || exit 1

Check health status:

docker compose ps
# Look for (healthy) or (unhealthy) next to backend-api

unhealthy during an upgrade is normal

The container stays unhealthy while database migrations run (several minutes for the ones that build indexes on a large table). See Upgrade Guide.


Prometheus metrics

Repod exposes Prometheus metrics at:

GET http://localhost:8000/metrics

Protecting the endpoint

/metrics is never public. Without credentials it answers 401.

  • Set METRICS_TOKEN in backend.env (a long random value, for example openssl rand -hex 32). Prometheus then sends it as a bearer token. A wrong token answers 403.
  • If METRICS_TOKEN is empty, the endpoint falls back to a normal login: it requires a JWT of an auditor account or above, which is awkward for a scraper (the JWT expires). Set the token.

Available metrics

Metric Type Description
repod_packages_total Gauge Packages in the repository (labels: distribution, arch)
repod_vulnerabilities_total Gauge CVE findings in the stored packages (label: severity, always critical, high, medium, low, negligible)
repod_pending_review_total Gauge Packages waiting for a CVE decision (not counting those already replaced by a published version)
repod_quarantine_total Gauge Packages in quarantine
repod_uploads_total Counter Uploads and imports since the backend started (label: status, success or failure)
repod_grype_db_age_seconds Gauge Age of the Grype vulnerability database. Absent when it cannot be read
repod_clamav_last_update Gauge Unix timestamp of the last ClamAV signature update. Absent when there is no database
repod_http_requests_total Counter HTTP requests (labels: method, path, status_code)
repod_http_request_duration_seconds Histogram Request latency (labels: method, path)

Counters restart from zero when the backend restarts, as usual for Prometheus: use rate() or increase(), never the raw value. The gauges are recomputed at every scrape.

Older versions

Before this was fixed, repod_packages_total, repod_vulnerabilities_total and repod_uploads_total were defined but always empty, and the pending-review, quarantine, Grype and ClamAV metrics did not exist.

Prometheus scrape configuration

prometheus.yml
scrape_configs:
  - job_name: repod
    metrics_path: /metrics
    scrape_interval: 30s
    authorization:
      type: Bearer
      credentials: "<the value of METRICS_TOKEN>"
    static_configs:
      - targets: ["repod-backend:8000"]

Grafana panels

Build your own from the metrics above. Useful panels:

  • Upload failure rate: rate(repod_uploads_total{status="failure"}[1h])
  • Packages by distribution: sum by (distribution) (repod_packages_total)
  • CVE findings by severity: repod_vulnerabilities_total
  • Pending-review queue depth: repod_pending_review_total
  • Grype database age: repod_grype_db_age_seconds / 3600
  • ClamAV signature age: time() - repod_clamav_last_update
  • HTTP latency p95: histogram_quantile(0.95, sum by (le) (rate(repod_http_request_duration_seconds_bucket[5m])))

Log monitoring

View logs in real time

# All containers
docker compose logs -f

# Backend only (last 200 lines)
docker compose logs backend --tail=200

# Filter for errors
docker compose logs backend 2>&1 | grep -iE "error|exception|traceback"

# Filter for security events
docker compose logs backend 2>&1 | grep -E "UPLOAD|SECURITY|CVE"

Structured audit log

The audit log at /repos/audit/YYYY-MM-DD.jsonl is the authoritative record of all security-relevant events. Query it with standard UNIX tools:

# Today's audit log, one compact line per event (the file is JSON Lines: one object per line)
docker exec backend-api sh -c 'tail -n 50 /repos/audit/$(date +%Y-%m-%d).jsonl' | jq -c .

# All failed logins today. The file is written with a space after each colon
# ("action": "LOGIN"): a search for "action":"LOGIN" without it finds nothing.
docker exec backend-api sh -c 'cat /repos/audit/$(date +%Y-%m-%d).jsonl' \
  | jq -c 'select(.action == "LOGIN" and .result == "FAILURE")'

# All CVE decisions in the last 7 days
for d in $(seq 0 6); do
  date --date="-$d days" +%Y-%m-%d
done | while read day; do
  docker exec backend-api sh -c "cat /repos/audit/$day.jsonl 2>/dev/null"
done | jq -c 'select(.action == "SECURITY_DECISION")'

Ship logs to a SIEM

The JSONL format is directly ingestible by most SIEM platforms:

logstash.conf
input {
  file {
    path  => "/opt/repod/repos/audit/*.jsonl"
    codec => "json"
    start_position => "beginning"
  }
}

filter {
  date {
    match => ["timestamp", "ISO8601"]
    target => "@timestamp"
  }
}

output {
  elasticsearch {
    hosts => ["http://elasticsearch:9200"]
    index => "repod-audit-%{+YYYY.MM.dd}"
  }
}

Configure a Universal Forwarder monitor input:

inputs.conf
[monitor:///opt/repod/repos/audit/*.jsonl]
disabled  = false
sourcetype = repod_audit
index     = security
promtail-config.yml
scrape_configs:
  - job_name: repod-audit
    static_configs:
      - targets: [localhost]
        labels:
          job: repod
          __path__: /opt/repod/repos/audit/*.jsonl
    pipeline_stages:
      - json:
          expressions:
            action: action
            result: result
            user: user
      - labels:
          action:
          result:

Alerting recommendations

Critical alerts (page immediately)

Condition Query / check
Backend container unhealthy docker inspect backend-api --format='{{.State.Health.Status}}' ≠ healthy
Backend not ready GET /health/ready answers anything but 200
ClamAV not running jq '.checks.non_critical.clamav' on /health reports a failure
Vulnerability database refused repod_grype_db_age_seconds > 432000: Grype rejects a database older than 120 h by default, and every scan then fails (see Air-gapped security data). Warn earlier, at 345600 (4 days)
Pending review queue growing repod_pending_review_total > 10 (tune per organisation)
Login failures spike more than 20 LOGIN events with result FAILURE in 5 min

Warning alerts (notify team)

Condition Query / check
ClamAV signatures not updated in 24 h time() - repod_clamav_last_update > 86400
Disk space low df -h /opt/repod/repos below 10 GB free, or used_pct in /health/ready
Upload failure rate above 5% rate(repod_uploads_total{status="failure"}[1h]) / rate(repod_uploads_total[1h]) > 0.05
Packages in quarantine repod_quarantine_total > 0

Security event monitoring

Monitor these audit event types for security operations:

Event Security signal
LOGIN with result=FAILURE Brute-force or credential stuffing attempt
USER_CREATE New account provisioned — verify intent
USER_ROLE_CHANGE Privilege escalation — verify intent
SECURITY_DECISION A CVE decision was recorded (risk accepted, exception, update required, rejection) — review the justification and the expiry
UPLOAD / IMPORT with result=PENDING_REVIEW A package was stored but not published, waiting for a CVE decision
SETTINGS_CHANGE Configuration change — verify intent

Checking component status manually

# ClamAV — version and signature date
docker exec backend-api clamscan --version

# Grype — database age and validity (instant; `grype db status` takes 20 to 50 seconds on a large database)
curl -s -H "Authorization: Bearer $TOKEN" http://localhost:8000/api/v1/security/grype/status | jq .

# GPG — list keys in keyring
docker exec -u appuser backend-api gpg --homedir /repos/gnupg --list-keys

# PostgreSQL — connection and table sanity check
docker exec repod-db psql -U repod -d repod -c \
  "SELECT count(*) AS users FROM users; SELECT count(*) AS manifests FROM manifests;"

Resource utilization

Monitor Docker resource usage with:

docker stats backend-api frontend-ui depot-apt

Only the backend has resource limits in docker-compose.yaml: 1.5 CPUs and 4 GB of RAM (clamd alone holds about 800 MB, and a catalogue of more than 500 000 packages needs about 2 GB). The other containers are not limited.

Raise the backend limits if ClamAV or Grype scans saturate the CPU, in a docker-compose.override.yml rather than by editing the main file:

docker-compose.override.yml
services:
  backend:
    deploy:
      resources:
        limits:
          cpus: "3.0"
          memory: 6g

Disk space management

# Total space used by repos volume
du -sh /opt/repod/repos/

# Breakdown by subdirectory
du -sh /opt/repod/repos/* | sort -rh

# Largest packages in the pool
du -sh /opt/repod/repos/pool/* 2>/dev/null | sort -rh | head -20

# Quarantine contents (review before deleting)
ls -lh /opt/repod/repos/staging/quarantine/

# ClamAV database size
du -sh /opt/repod/repos/clamav-db/

# Grype database size
du -sh /opt/repod/repos/grype-db/

Configure automatic retention cleanup in Administration → Paramètres, section Rétention & nettoyage in the web UI (default: 90 days for audit logs, no automatic package cleanup).