Expand description
Axum integration for asyncq — admin REST endpoints with Prometheus metrics.
§Setup
Mount the admin router on any path in your axum application:
use asyncq::{Queue, backends::InMemoryBackend};
use asyncq_axum::admin;
use axum::Router;
let queue = Queue::new(InMemoryBackend::new());
let app = Router::new()
.nest("/admin", admin(queue))
/* ... your other routes ... */;§Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /admin/queues/:name | Stats for a queue |
| GET | /admin/queues/:name/dlq | Dead-letter queue (paginated) |
| POST | /admin/queues/:name/dlq/retry-all | Requeue all dead jobs |
| DELETE | /admin/queues/:name/dlq/:id | Retry one dead job by ID |
| GET | /admin/metrics | Prometheus text metrics |
Functions§
- admin
- Build the admin Router. Mount it with
router.nest("/admin", admin(queue)). - admin_
with_ queues - Build the admin Router with live Prometheus metrics for the given queue names.