Skip to main content

FastAPI health checks

Configurable health checks endpoints for FastAPI applications.

Quickstart

app = FastAPI()
app.include_router(
    HealthcheckRouter(
        Probe(
            name="readiness",
            checks=[
                PostgreSqlCheck(host="db.example.com", username=..., password=...),
                RedisCheck(host="redis.example.com", username=..., password=...),
            ],
        ),
        Probe(
            name="liveness",
            checks=[
                ...,
            ],
        ),
    ),
    prefix="/health",
)

The probes from this example will be available as GET /health/readiness and GET /health/liveness.

Bundled checks

  • PostgreSqlCheck – checks PostgreSQL server availability
  • RedisCheck – checks Redis server availability
  • RabbitMqCheck – checks RabbitMQ server availability
  • SettingsCheck – validates settings models based on pydantic BaseModel
  • HttpCheck – checks availability of specified URL
  • CephCheck – checks Ceph server availability

Custom checks

You can create your own checks by providing custom fastapi_healthchecks.checks.Check implementations. Like this:

class MaintenanceCheck(Check):
    async def __call__(self) -> CheckResult:
        if is_maintenance():
            return CheckResult(name="Maintenance", passed=False, details="Closed for maintenance")
        else:
            return CheckResult(name="Maintenance", passed=True)

Metadata

Release files for fastapi-healthchecks 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-healthchecks 1.1.0
File Size Uploaded Provenance Actions
fastapi_healthchecks-1.1.0.tar.gz 6.5 kB Without provenance Details for fastapi_healthchecks-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-healthchecks 1.1.0
File Interpreter ABI Platform Actions
fastapi_healthchecks-1.1.0-py3-none-any.whl Python 3 none any Details for fastapi_healthchecks-1.1.0-py3-none-any.whl

Total release size: 16.5 kB

Release files / fastapi_healthchecks-1.1.0.tar.gz

Download URL fastapi_healthchecks-1.1.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2a2b12b9e18dadda78888cda4c0834fc6d3a4552e3a2c4ffad840f6e1dca24e3
BLAKE2b-256 checksum
How to use checksums
a04917cee6fdca63962129b65352eb42107878c778becf74b0354a10048f5d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/5.15.0-82-generic

Release files / fastapi_healthchecks-1.1.0-py3-none-any.whl

Download URL fastapi_healthchecks-1.1.0-py3-none-any.whl
Size 9.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c75e5c7abddeb806ffd95219a73ab79d66435e47197ed4d710fd7f48af382c5
BLAKE2b-256 checksum
How to use checksums
fe0d7e2dc4363e52bb39fadb9314d6a755ff53263a4e389e551bd9bd0516ab18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.13 Linux/5.15.0-82-generic

Security for fastapi-healthchecks 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page