API Reference
Models for healthchecks.
HealthCheckResult
dataclass
Result of a healthcheck.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the healthcheck. |
healthy |
bool
|
Whether the healthcheck passed. |
error_details |
str | None
|
Details of the error if the healthcheck failed. |
Source code in fast_healthchecks/models.py
HealthcheckReport
dataclass
Report of healthchecks.
Attributes:
Name | Type | Description |
---|---|---|
healthy |
bool
|
Whether all healthchecks passed. |
results |
list[HealthCheckResult]
|
List of healthcheck results. |
Source code in fast_healthchecks/models.py
healthy: bool
property
Return whether all healthchecks passed.
FastAPI integration for health checks.
HealthcheckRouter
Bases: APIRouter
A router for health checks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
probes
|
Probe
|
An iterable of probes to run. |
()
|
debug
|
bool
|
Whether to include the probes in the schema. Defaults to False. |
False
|
Source code in fast_healthchecks/integrations/fastapi.py
__init__(*probes, success_handler=default_handler, failure_handler=default_handler, success_status=status.HTTP_204_NO_CONTENT, failure_status=status.HTTP_503_SERVICE_UNAVAILABLE, debug=False, prefix='/health', **kwargs)
Initialize the router.
Source code in fast_healthchecks/integrations/fastapi.py
FastStream integration for health checks.
health(*probes, success_handler=default_handler, failure_handler=default_handler, success_status=HTTPStatus.NO_CONTENT, failure_status=HTTPStatus.SERVICE_UNAVAILABLE, debug=False, prefix='/health')
Make list of routes for healthchecks.
Source code in fast_healthchecks/integrations/faststream.py
FastAPI integration for health checks.
health(*probes, success_handler=default_handler, failure_handler=default_handler, success_status=HTTPStatus.NO_CONTENT, failure_status=HTTPStatus.SERVICE_UNAVAILABLE, debug=False, prefix='/health')
Make list of routes for healthchecks.