Skip to main content

file-healthchecker

Use this application to monitor your long running "non-web" application's health check.

Build Status

Installation

pip

pip install file-healthchecker

Use Case

Lets say we have a service which needs to perform some action every x-duration. In python-world we would simply run it inside a while loop and invoke it every x-minutes.

Now define an environment var ENV_HEALTH_CHECK_FILE which will represent a file creation in case the app is healthy. for e.g. export ENV_HEALTH_CHECK_FILE=/tmp/myapp.is.healthy

This following snippet will perform following tasks:

  • Every invocation of my_application will first remove a health-check file.
  • Run the application
  • NOTE: Raise an exception in case the application is failing. Handle it outside, as show in the given example.
  • If no exception is raised, the decorator will create a file defined by the env-var ENV_HEALTH_CHECK_FILE
from file_healthchecker import decorator_success
import time

@decorator_success
def my_application():
    ... doing lots of work
    ... more work
    # in case of failure, raise exception
    return True

if __name__ == "__main__":
    while True:
        try:
            my_application()
        except Exception:
            pass
        time.sleep(10)

With the installation another cmd-app also gets installed - checkhealth.

How to check application's health?

  • One can simply run ENV_HEALTH_CHECK_FILE=/tmp/myapp.is.healthy checkhealth at regular intervals or
  • pass this command to orchestrators like Nomad, Kubernetes, etc. as a part of their health-check commands.

Current Stable Version

0.1.0

Development Installation

  • Clone the project.
  • Now install the application in editable mode and you are ready to start development
$ pip install -e .

Test

To run the tests:

make test

License

MIT

Metadata

Release files for file-healthchecker 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file-healthchecker 0.1.1
File Size Uploaded Provenance Actions
file-healthchecker-0.1.1.tar.gz 4.1 kB Without provenance Details for file-healthchecker-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for file-healthchecker 0.1.1
File Interpreter ABI Platform Actions
file_healthchecker-0.1.1-py3-none-any.whl Python 3 none any Details for file_healthchecker-0.1.1-py3-none-any.whl

Total release size: 9.2 kB

Release files / file-healthchecker-0.1.1.tar.gz

Download URL file-healthchecker-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
75710a078bc03b39297f623a8698c292436607011e266e1a4d322fa9c94bb32b
BLAKE2b-256 checksum
How to use checksums
f68ba38717e614653e0c37cd155176dcc0fa235409db908cffc0bee8b70fa440
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.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

Release files / file_healthchecker-0.1.1-py3-none-any.whl

Download URL file_healthchecker-0.1.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8363787ea10b7e71990e25261ec52cfc4275580f7b9400ca33810a324d10e961
BLAKE2b-256 checksum
How to use checksums
282cfc3e7690563075c1f96cbec49db4fc14481eb99551f17d98e78ddca5a8e2
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.post20191030 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

Security for file-healthchecker 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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