Skip to content

Health & metrics

Liveness probe. Returns 200 once the application has started.

Terminal window
curl http://localhost:8000/healthz
# {"status":"ok"}

Used by Kubernetes livenessProbe. The default initialDelaySeconds: 60 accounts for spaCy en_core_web_lg loading (~800 MB).

Readiness probe. Returns 200 only when the database, ChromaDB when enabled, and the configured rate-limit backend are reachable. A dependency failure returns 503.

Terminal window
curl http://localhost:8000/readyz
# {"status":"ready","checks":{"database":"ok","vector_store":"ok","rate_limiter":"ok"}}

Used by Kubernetes readinessProbe. Traffic is not routed to a pod until this returns 200.

Prometheus text format metrics. The master key is required by default:

Terminal window
curl http://localhost:8000/metrics \
-H "Authorization: Bearer $PROXY_MASTER_KEY"

Key metrics exposed:

MetricTypeLabelsDescription
relay_requests_totalCountermodel, statusTotal inference requests
relay_request_latency_secondsHistogrammodel, streamEnd-to-end request latency
relay_tokens_totalCountermodel, token_typeTokens consumed (prompt/completion)
relay_rate_limit_hits_totalCounterlimit_typeRate limit rejections
relay_cache_hits_totalCountermodelCache hits
relay_pii_entities_scrubbed_totalCounterPII entities scrubbed
relay_pii_requests_affected_totalCounterRequests containing PII
relay_content_policy_blocks_totalCounterContent policy rejections

Enable automatic scraping with Prometheus Operator:

values.yaml
prometheus:
serviceMonitor:
enabled: true
interval: "15s"
scrapeTimeout: "10s"
labels:
release: prometheus # match your Prometheus Operator release label

The generated ServiceMonitor reads the bearer credential from Relay’s master-key Secret when config.metricsRequireAuth is enabled.

prometheus.yml
scrape_configs:
- job_name: llm-proxy
static_configs:
- targets: ["proxy.internal:8000"]
metrics_path: /metrics
authorization:
type: Bearer
credentials_file: /etc/prometheus/secrets/relay-master-key