Skip to main content

sanic-healthcheck

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.

Installing

pip install sanic-healthcheck

Documentation

For full project documentation, see: https://sanic-healthcheck.readthedocs.io/en/latest/

Example

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)


@app.route('/')
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)

    app.run(host='0.0.0.0', port=8000)

License

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

Download files

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

Source Distribution

sanic_healthcheck-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sanic_healthcheck-0.1.0-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sanic_healthcheck-0.1.0.tar.gz.

File metadata

  • Download URL: sanic_healthcheck-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.7

File hashes

Hashes for sanic_healthcheck-0.1.0.tar.gz
Algorithm Hash digest
SHA256 36eb2340673ff54bde13454213840444fdbb3d6928fb4f1aecae666c9d59ed23
MD5 112f27d84ef8f9f27a072bcd2bb70e30
BLAKE2b-256 74ca710abd37ea915aefc1b02410e400e51c16508849587685e000425867dec3

See more details on using hashes here.

File details

Details for the file sanic_healthcheck-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: sanic_healthcheck-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.7

File hashes

Hashes for sanic_healthcheck-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3720191aca270e95e30e38295d1dc8985683e93fee5febe00aaf9d9235f78457
MD5 1359096856445c72be9eee85d205710b
BLAKE2b-256 242886a58ec198f90b5f00366b33b1d3ed9ce9a7e29b80ca4c9b5d2b5f127ba9

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

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