Skip to content

Checks and adapters

CheckConfig

Each check is a CheckConfig entry in the checks array on the root config:

FieldPurpose
nameKey in the response checks object.
typeOne or both of "liveness" and "readiness". Only checks that include the probe type run for that probe. If none match, the response is still 200 with an empty checks object.
adapterMust implement HealthAdapter: check(): Promise<AdapterResult>.
timeoutPer-check timeout in milliseconds. Default 5000, unless overridden by defaults.timeout.
scheduleOptional { intervalMs }. When kit.start() has been called, the adapter runs on that interval and results are cached (see Scheduling).
onFailOptional httpStatus, treatAs (for example map "fail" to "degraded" for rollup and body while adjusting HTTP rules).
onDegradedPresent on the type; degraded HTTP status for the overall response is controlled via defaults.onDegraded (see Responses and HTTP).

AdapterResult

Each adapter.check() resolves to:

  • status: "ok" | "degraded" | "fail".
  • error: Optional Error or string (included in the serialized check unless output.exposeError is false).
  • metadata: Optional object merged into the check result.

Thrown errors from adapter.check() are treated as fail, with the error message captured when exposeError is true.

Official adapters

This monorepo publishes optional packages that return a HealthAdapter for common infrastructure: queues, databases, storage, search, and HTTP endpoints. For anything else, use a custom adapter.check() implementation.

Queues

Databases

Storage

  • S3@healthzkit/s3
  • MinIO@healthzkit/minio

HTTP

Released under the AGPL-3.0 License.