monitor.server¶
MonitorServer — FastAPI web server for the otto monitoring dashboard.
Endpoints¶
GET / Serves dashboard.html GET /static/… Serves static assets (plotly.min.js, etc.) GET /api/meta JSON metadata (host name, metric labels, units) GET /api/data JSON snapshot of all metric series and events GET /api/stream SSE stream — pushes metric updates and events in real time POST /api/event Record a manual event from the dashboard UI
-
class otto.monitor.server.MonitorServer(collector: MetricCollector, host: str =
'0.0.0.0', port: int =0)¶ Bases:
objectWraps a FastAPI/uvicorn server for the monitoring dashboard.
Call
await serve()from an async context to run the server. Callstop()from any thread to trigger a graceful shutdown.