What
Implement an embedded observability dashboard directly into the existing FastAPI server to visualize local DuckDB telemetry and trace data.
Why
We recently transitioned to local JSON file logging and tracing. To keep the infrastructure footprint minimal (avoiding standalone tools like Grafana), we want to embed an interactive, lightweight dashboard using DuckDB's Python client and an interactive charting library (e.g., Chart.js or ECharts) served directly by FastAPI.
How
- Install
duckdb via uv.
- Write a Python wrapper class to execute queries against the
blacki-traces.log and blacki-telemetry.log files.
- Add a new FastAPI endpoint (e.g.,
/api/telemetry/stats) that returns aggregated JSON data (like token usage over time).
- Add a FastAPI route (e.g.,
/dashboard) that serves a simple HTML page containing interactive frontend graphs.
- Provide a foundation to easily add an ADK tool for Telegram querying later.
Priority
Medium
Level of Effort
Medium (1-2 days)
Sources
Passing Criteria
- The
duckdb Python package is successfully added to the pyproject.toml and installed via uv.
- FastAPI serves a
/dashboard endpoint returning an HTML page.
- FastAPI serves an
/api/telemetry/stats endpoint returning aggregated JSON metrics queried from the local logs.
- The HTML dashboard correctly fetches the metrics and renders an interactive chart (e.g., plotting token usage).
- Automated tests pass asserting that the API endpoint returns valid JSON and the dashboard endpoint returns HTML.
What
Implement an embedded observability dashboard directly into the existing FastAPI server to visualize local DuckDB telemetry and trace data.
Why
We recently transitioned to local JSON file logging and tracing. To keep the infrastructure footprint minimal (avoiding standalone tools like Grafana), we want to embed an interactive, lightweight dashboard using DuckDB's Python client and an interactive charting library (e.g., Chart.js or ECharts) served directly by FastAPI.
How
duckdbviauv.blacki-traces.logandblacki-telemetry.logfiles./api/telemetry/stats) that returns aggregated JSON data (like token usage over time)./dashboard) that serves a simple HTML page containing interactive frontend graphs.Priority
Medium
Level of Effort
Medium (1-2 days)
Sources
src/blacki/server.pyPassing Criteria
duckdbPython package is successfully added to thepyproject.tomland installed viauv./dashboardendpoint returning an HTML page./api/telemetry/statsendpoint returning aggregated JSON metrics queried from the local logs.