A tiny DSL for service readiness/liveness checks — run concurrently, aggregated correctly, serialized anywhere.

health-dsl documentation

health-dsl is a tiny DSL for declaring service readiness/liveness checks — they run concurrently, aggregate to a correct overall status, and serialize anywhere.

Most services grow an ad-hoc /health endpoint: a pile of try/catch blocks, inconsistent timeouts, one slow dependency that hangs the whole probe, and no clear distinction between “we are down” and “we are degraded but still serving.” health-dsl makes that a declaration.

What it gives you

  • Correct aggregation. A critical dependency that is DOWN makes the system DOWN; a non-critical failure (or any degraded check) caps the system at DEGRADED but still healthy. You stop conflating “page someone” with “we are fine.”
  • Concurrency + per-check timeouts. report.durationMs is roughly your slowest check, not the sum. A hung dependency becomes a DOWN outcome after its timeout.
  • No check can break the report. Exceptions, panics, and timeouts fold into a DOWN outcome (cancellation is still propagated).
  • Serialize anywhere. A dependency-free JSON renderer plus a map/struct form for Jackson, kotlinx.serialization, serde, or a Spring Actuator HealthIndicator.