Skip to main content

Health checks for your Sanic applications

Project description


sanic-healthcheck provides a simple way to add health checks and readiness checks to your Sanic application. This makes it easier to monitor your application and ensure it is running in a health state. Monitoring or management tools can ping these endpoints to determine application uptime and status, as well as perform application restart to ensure your application isn't running in a degraded state.

sanic-healthcheck was inspired by and borrows from Runscope/healthcheck.


pip install sanic-healthcheck


For full project documentation, see:


Below is a trivial example showcasing basic usage of sanic-healthcheck

import random

from sanic import Sanic, response
from sanic_healthcheck import HealthCheck

app = Sanic()
health_check = HealthCheck(app)

async def test(request):
    return response.json({'hello', 'world'})

# Define checks for the health check.
def check_health_random():
    if random.random() > 0.9:
        return False, 'the random number is > 0.9'
    return True, 'the random number is <= 0.9'

if __name__ == '__main__':
    health_check.add_check(check_health_random)'', port=8000)


sanic-healthcheck is licensed under the MIT license. See LICENSE for details.

Project details

Download files

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

Files for sanic-healthcheck, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size sanic_healthcheck-0.1.1.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View
Filename, size sanic_healthcheck-0.1.1-py2.py3-none-any.whl (9.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page