Applipy HealthCheck Metrics
pip install applipy_healthcheck
Exposes the health status of the applipy application through an HTTP endpoint with path /health.
Usage
Add the applipy_healthcheck.HealthCheckModule to your application. Optionally,
define through which http server to expose the /health endpoint, if no name
is given it defaults to the anonymous server:
# dev.yaml
app:
name: demo
modules:
- applipy_healthcheck.HealthCheckModule
http.servers:
- name: internal
host: 0.0.0.0
port: 8080
healthcheck.server_name: internal
To run this test just install applipy_healthcheck and pyyaml and run the applipy application:
pip install applipy_healthcheck pyyaml
python -m applipy
You can now query http://0.0.0.0:8080/health
and you should see OK being returned.
Custom health checks
applipy_healthcheck exposes the HealthChecker interface. You can implement
your own and the health check endpoint will use it to determine the health of
the system.
Example
Full healthcheck module config
All keys and their default values:
healthcheck:
server_name: null
verbose: false
Usage with custom HealthChecker
# mymodule.py
from applipy import Module
from applipy_healthcheck import HealthChecker
class MyHealthChecker(HealthChecker):
async def check(self):
is_healthy = True
status_message = 'All OK'
return is_healthy, status_message
class MyModule(Module):
def configure(self, bind, register):
bind(HealthChecker, MyHealthChecker)
@classmethod
def depends_on(cls):
return HealthCheckModule,
# dev.yaml
app:
name: test
modules: [mymodule.MyModule]
http.servers:
- host: 0.0.0.0
port: 8080
Metadata
Release files for applipy-healthcheck 0.2.0
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 |
|---|---|---|---|---|
| applipy_healthcheck-0.2.0.tar.gz | 4.0 kB | Without provenance | Details for applipy_healthcheck-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| applipy_healthcheck-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for applipy_healthcheck-0.2.0-py3-none-any.whl |
Total release size: 8.8 kB
Release files / applipy_healthcheck-0.2.0.tar.gz
| Download URL | applipy_healthcheck-0.2.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77f9021da710d51acb18cba1c27990a724544c217951c7cfe2ef5e3fa0c05a2a
|
|
BLAKE2b-256 checksum How to use checksums |
f70087bdbeb9cb660a45d9cf8d9dd37109bb55a986dda5af62770b17b7898fd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Release files / applipy_healthcheck-0.2.0-py3-none-any.whl
| Download URL | applipy_healthcheck-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8465f46d7c694f992b51db4726014e12901ad5710001ae768927dd46bcfeaba9
|
|
BLAKE2b-256 checksum How to use checksums |
fda5cfa8df369dd3a9c840d01a6376bfe6dcb6769679380c9d48298722ec9cbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Security for applipy-healthcheck 0.2.0
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.