Skip to main content

A module to have a FastAPI HealthCheck reach out to a URI to validate external service health.

Project description

fastapi_healthcheck_uri

A module to have a FastAPI HealthCheck reach out to a URI to validate external service health.

Adding Health Checks

Here is what you need to get started.

from fastapi import FastAPI
from fastapi_healthcheck import HealthCheckFactory, healthCheckRoute
from fastapi_healthcheck_uri import HealthCheckUri

app = FastAPI()

# Add Health Checks
_healthChecks = HealthCheckFactory()
_healthChecks.add(
    HealthCheckUri(
        alias='reddit', 
        connectionUri="https://www.reddit.com/r/aww.json", 
        tags=('external', 'reddit', 'aww'),
        healthyCode=200,
        unhealthyCode=500
    )
)
app.add_api_route('/health', endpoint=healthCheckRoute(factory=_healthChecks))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_healthcheck_uri-0.1.0.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

fastapi_healthcheck_uri-0.1.0-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page