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.
Metadata
Release files for sanic-healthcheck 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sanic_healthcheck-0.1.1.tar.gz | 6.9 kB | Without provenance | Details for sanic_healthcheck-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sanic_healthcheck-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for sanic_healthcheck-0.1.1-py2.py3-none-any.whl |
Total release size: 16.2 kB
Release files / sanic_healthcheck-0.1.1.tar.gz
| Download URL | sanic_healthcheck-0.1.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
107230dc6f3594977b8f71d3c5a624c40b2c7c0ebf2650192d0cf9401dfadf72
|
|
BLAKE2b-256 checksum How to use checksums |
33807fa35f906588f8c97ddc10d87799dbd32fe739cd3389c6fbfb4d311c5a75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / sanic_healthcheck-0.1.1-py2.py3-none-any.whl
| Download URL | sanic_healthcheck-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b2e5b5717de59a3b87d9abcf3b3a32fe181e911fc4eccfe06cf070630f27ca02
|
|
BLAKE2b-256 checksum How to use checksums |
c4718aa293ce4bd1f1afd9775f04c92d4cb6dab28f2aa809dc3eea65acf30559
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for sanic-healthcheck 0.1.1
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.