Skip to content

health

Health check handler for the application.

Returns the app settings as details if successful, otherwise a 503.

AbstractHealthCheck

Bases: ABC

Base protocol for implementing health checks.

live async

live()

Run a liveness check.

Returns:

Type Description
bool

True if the service is running, False otherwise

ready abstractmethod async

ready()

Run readiness check.

Returns:

Type Description
bool

True if the service is ready to serve requests, False otherwise

AppHealthCheck

Bases: AbstractHealthCheck

Simple health check that does not require any dependencies.

ready async

ready()

Readiness check used when no other health check is available.

HealthCheckFailure

HealthCheckFailure(health, *args, detail='', status_code=None, headers=None, extra=None)

Bases: ServiceUnavailableException

Raise for health check failure.

HealthController

Bases: Controller

Holds health endpoints.

health_check async

health_check()

Run registered health checks.

HealthResource

Bases: BaseModel

Health data returned by the health endpoint.

health_failure_exception_handler

health_failure_exception_handler(_, exc)

Return all health checks data on HealthCheckFailure.