Skip to main content

Module health

Module health 

Source
Expand description

RFC 8458 health check response types.

Implements the IETF Health Check Response Format for HTTP APIs (draft-inadarei-api-health-check).

§Wire format

Content-Type: application/health+json

§Liveness (GET /health)

{"status": "pass", "version": "1.0.0", "serviceId": "my-service"}

§Readiness (GET /health/ready)

{
  "status": "pass",
  "version": "1.0.0",
  "serviceId": "my-service",
  "checks": {
    "postgres:connection": [{"componentType": "datastore", "status": "pass"}]
  }
}

§HTTP status codes

  • LivenessResponse → always 200 OK
  • ReadinessResponse200 OK on pass/warn, 503 Service Unavailable on fail

Structs§

HealthCheck
Individual component check result (RFC 8458 §4).
HealthCheckBuilder
Typestate builder for HealthCheck.
LivenessResponse
Liveness probe response (GET /health) — RFC 8458.
ReadinessResponse
Readiness/startup probe response (GET /health/ready, GET /health/startup) — RFC 8458.
ReadinessResponseBuilder
Typestate builder for ReadinessResponse.

Enums§

HealthStatus
RFC 8458 §3 health check status.