Expand description
JSON API dashboard for monitoring the kojin task queue.
Provides both an embeddable axum::Router via dashboard_router() and a
standalone binary.
§Endpoints
| Endpoint | Description |
|---|---|
GET / | Web UI dashboard |
GET /healthz | K8s liveness/readiness probe |
GET /api/queues | List queues with lengths + DLQ lengths |
GET /api/queues/:name | Single queue detail |
GET /api/queues/:name/dlq | Paginated DLQ messages |
GET /api/metrics | Throughput counters (requires MetricsMiddleware) |
GET /api/tasks/:id | Task result lookup (requires ResultBackend) |
§Example
use std::sync::Arc;
use kojin_core::MemoryBroker;
use kojin_dashboard::{DashboardState, dashboard_router};
let broker = Arc::new(MemoryBroker::new());
let state = DashboardState::new(broker);
let app = dashboard_router(state);
let listener = tokio::net::TcpListener::bind("0.0.0.0:9090").await.unwrap();
axum::serve(listener, app).await.unwrap();Re-exports§
pub use state::DashboardState;
Modules§
Structs§
- Dashboard
Config - Configuration for the standalone dashboard server.
Functions§
- dashboard_
router - Build the dashboard
Routerwith all API routes and web UI. - spawn_
dashboard - Start the dashboard as a background Tokio task. Returns the join handle.