Skip to content

Monitoring & Alerting ​

LLM Proxy exposes health and traffic data through its API so you can build dashboards and alerts on top of them.

Health ​

EndpointUse
GET /api/healthFull snapshot of database and Redis status; always returns HTTP 200
GET /api/health/readyReturns 503 when not ready; use for load balancer and orchestrator readiness probes
GET /api/health/liveAlways returns 200; use for liveness probes
bash
curl -s http://localhost:8080/api/health/ready | jq .

Traffic and reliability ​

SignalWhere
Requests, cost, tokens, success rateGET /api/logs/usage-stats or the Usage dashboard
Average response time, average TTFT, tokens/second, cache savingsSame response (summary)
Provider/model breakdown, daily seriesby_provider, by_model, daily_usage
Error rate by statusGET /api/logs?status_code=… or status_code_from/status_code_to
Retries and fallbacksLog metadata: retry_count, fallback_count, fallback_providers
Circuit breaker stateGET /api/config/circuit-breaker (admin), with reset endpoints
Latest log timestamp and total count (lightweight, for polling)GET /api/logs/stats
Client disconnectsLogs with status 499

Usage buckets are always UTC days and hours regardless of server timezone: a start_date without an offset selects a UTC day, and daily_usage keys are UTC dates. Pass a full ISO timestamp with an offset to query a local day.

::: note Averages, not percentiles Latency and throughput are reported as averages; there are no p50/p95/p99 endpoints. To compute percentiles, export request logs (GET /api/logs, cursor pagination, up to 200 per page) into your own store. :::

What to alert on ​

ConditionWhy
/api/health/ready != 200Database is down, or Redis is enabled and unhealthy
Status 5xx trending upProvider failures, timeouts, or configuration errors (502 = upstream/parse error, 504 = timeout)
fallback_count > 0 repeatedlyA preferred provider is degraded
Circuit breaker tripsProvider outage; the proxy is already routing around it
499s trending upClients or CDNs are timing out; check keepalive settings and CDN timeouts
429 budget_exceededA client hit its cap (expected limit or runaway loop)
429 too_many_auth_failuresBad key deployed, or probing traffic
Audit chain verification failsTampering or corruption; investigate immediately
bash
# 5xx in the last hour
curl -s "http://localhost:8080/api/logs?status_code_from=500&status_code_to=599&page_size=200" \
  -H "Authorization: Bearer $ADMIN_JWT" | jq '.items | length'

# Audit integrity (admin)
curl -s "http://localhost:8080/api/logs/audit/verify-integrity" \
  -H "Authorization: Bearer $ADMIN_JWT" | jq '{valid, verified_count, errors}'

External systems ​

SystemIntegration
LangfusePer-user tracing (Account → Preferences → Tracing). One observation per request with type-specific input/output (chat messages, embeddings, rerank queries/rankings, image prompts/URLs, audio inputs/outputs), plus usage, cost, and user/session IDs
OpenTelemetry (OTLP)Per-user tracing to any OTLP collector over HTTP/protobuf or gRPC. One CLIENT span per request with GenAI semantic convention attributes, input/output payloads, and llm_proxy.* metadata. See Logs, Usage & Tracing
LangSmithPer-user tracing to LangSmith's OTLP/HTTP gateway. Same span structure, plus gen_ai.system, flattened message attributes, and langsmith.* run correlation
Log aggregationThe proxy does not push logs to external sinks (Redis log shipping is not implemented). Pull from GET /api/logs or collect application stdout
Application logsLOG_LEVEL (startup), --log-file, container stdout

To correlate traces, send x-langfuse-trace-id (or x-trace-id) on a request so Langfuse uses it as the trace ID. Responses return a trace ID header, and both headers are CORS-exposed for browser clients.

Operational hygiene ​

  • Logs default to 30 days of retention; audit logs and usage records share the same window. Adjust this in Settings → Log Management, or clean up manually with DELETE /api/logs/cleanup?older_than_days=N (admin-only; omitting the parameter applies the configured retention window, and both request logs and usage records are pruned). Add delete_all=true to wipe both tables regardless of age. Batch files and job rows use their own Batch Retention Period (default 30 days) and are not affected by manual log cleanup.
  • Keep sampling_rate at 1.0 while investigating issues; lower it to reduce storage without losing metadata.
  • Usage and logs are stored in the database; see Upgrades & Backups.
  • If you see dropped-record warnings in application logs, increase LOG_WRITE_QUEUE_SIZE or USAGE_WRITE_QUEUE_SIZE and restart.

MIT licensed