axum-health
Liveness, readiness and startup probes for Axum that follow the MicroProfile Health response format, so Kubernetes and load balancers get predictable answers under failure and load.
Availability
Use axum-health from source as a Git dependency. The crate with the same name on crates.io is an unrelated project. Requires Rust 1.85 or later.
Details
Health::builder() collects named async checks, and
Health::router() serves them at /health,
/health/live, /health/ready and
/health/started, or at a path of your choosing. Checks
run concurrently and results come back in registration order.
The response is JSON with an aggregate UP or
DOWN status and a checks array. Everything
up returns 200; any failing check returns 503, and an error becomes a
named DOWN entry with the message in its data.
Register checks as closures, or put #[liveness],
#[readiness] or #[startup] on methods of a
struct that already owns your database pool, REST client or LDAP
connection. Each check can attach structured diagnostic data.