Healthchecks Decorator
Project description
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
This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template.
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
Built Distribution
Hashes for healthchecks-decorator-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6553ee3c13f56b3f916e373c73e2c78e1652b328f727c60f7eb8d3ddd9f04d52 |
|
MD5 | ae659b0aaaa07410095a2950c4edf1f1 |
|
BLAKE2b-256 | 6bdb88d5bac1f13a229426889260245189edfebd7b34a25722f9da7acc3a0036 |
Hashes for healthchecks_decorator-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 197a553e8bf1f66b3dc4fd34bba6b236870d3111d5fbb9e7b63893a9746ce4b4 |
|
MD5 | f5dcd7a3b58d438f5fe9a99ebe1bce08 |
|
BLAKE2b-256 | a0b4c6476e8fdc0ec66f8c3c2c812f66206123e0097a42f879296ed04fc2399d |