Healthchecks Decorator
A simple python decorator for healthchecks.io.
Features
- Just decorate your function with
@healthcheck
🚀. - Support sending
/start
signals to measure job execution times ⏲️. - Automatic
/failure
signals when jobs produce exceptions 🔥. - Support both SaaS and self-hosted endpoints 😊.
Requirements
- None – only pure python 🐍.
Installation
You can install Healthchecks Decorator via pip from PyPI:
$ pip install healthchecks-decorator
Usage
from healthchecks_decorator import healthcheck
@healthcheck(url="https://hc-ping.com/<uuid1>")
def job():
"""Job with a success healthcheck signal when done"""
pass
@healthcheck(url="https://hc-ping.com/<uuid2>", send_start=True)
def job_with_start():
"""Send also a /start signal before starting"""
pass
@healthcheck(url="https://hc-ping.com/<uuid3>")
def job_with_exception():
"""This will produce a /fail signal"""
raise Exception("I'll be propagated")
Please see the Documentation for details.
Contributing
Contributions are very welcome. To learn more, see the Contributor Guide.
License
Distributed under the terms of the MIT license, Healthchecks Decorator is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Credits
- healthchecks.io.
- This project was generated from @cjolowicz‘s Hypermodern Python Cookiecutter template.