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
criticaldependency that isDOWNmakes the systemDOWN; a non-critical failure (or anydegradedcheck) caps the system atDEGRADEDbut still healthy. You stop conflating “page someone” with “we are fine.” - ▸Concurrency + per-check timeouts.
report.durationMsis roughly your slowest check, not the sum. A hung dependency becomes aDOWNoutcome after its timeout. - ▸No check can break the report. Exceptions, panics, and timeouts fold into a
DOWNoutcome (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.