Files
anyllm-proxy/crates/proxy
whit3rabbitandClaude Opus 4.6 6148b44e46 feat: add admin dashboard with request logging and observability
Localhost-only admin server (default port 3001) with:
- Web UI dashboard with live request feed via WebSocket
- SQLite-backed request log with pagination and filtering
- Hot-reload config (model mappings, log level, log bodies) persisted
  to SQLite across restarts
- Per-backend metrics with error rate tracking
- Token-based auth (random UUID printed to stderr, or set ADMIN_TOKEN)
- Automatic log retention purge (ADMIN_LOG_RETENTION_DAYS, default 7)

Supporting changes:
- Backend error types gain status_code() for request log entries
- Metrics gains Clone, Default, error_rate() for admin aggregation
- Routes track per-request context (RequestCtx) and log to admin
- Error responses sanitized: internal details logged server-side only,
  clients receive generic messages (prevents infrastructure leaks)
- SSE buffer guard (10 MB max) prevents unbounded memory from
  misbehaving backends
- New deps: rusqlite (bundled), toml, indexmap, bytes, axum ws feature

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:34:48 -05:00
..