Skip to main content

Crate kojin_dashboard

Crate kojin_dashboard 

Source
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

EndpointDescription
GET /Web UI dashboard
GET /healthzK8s liveness/readiness probe
GET /api/queuesList queues with lengths + DLQ lengths
GET /api/queues/:nameSingle queue detail
GET /api/queues/:name/dlqPaginated DLQ messages
GET /api/metricsThroughput counters (requires MetricsMiddleware)
GET /api/tasks/:idTask 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§

routes
state

Structs§

DashboardConfig
Configuration for the standalone dashboard server.

Functions§

dashboard_router
Build the dashboard Router with all API routes and web UI.
spawn_dashboard
Start the dashboard as a background Tokio task. Returns the join handle.