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, host=
'0.0.0.0', port=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.- property url : str¶
Primary URL using the first detected non-loopback IP (or the bind address).
- property urls : list[str]¶
All URLs the server is reachable on (one per non-loopback interface).
- property started : bool¶
True once the server is ready to accept connections.