ateliedocodigo / py-healthcheck Goto Github PK
View Code? Open in Web Editor NEWWrite simple healthcheck functions for your Flask or Tornado apps.
License: MIT License
Write simple healthcheck functions for your Flask or Tornado apps.
License: MIT License
Is there any link to the documentation of this module. Kindly share if there or any future plans.
Publish a conda package to conda-forge
{
"status": "UP",
"sample": {
"details": {
"url": "http://sample.com"
},
"status": "UP"
}
}
Currently the output of each check is
{
"status": "failure",
"results": [
{
"output": "'NoneType' object has no attribute '__getitem__'",
"checker": "throws_exception",
"passed": false
}
]
}
We want to append elapsed time of each check like this:
{
"status": "failure",
"results": [
{
"output": "'NoneType' object has no attribute '__getitem__'",
"checker": "throws_exception",
"passed": false,
"response_time": 9999999999
}
]
}
Implement some method that add non critical healthcheck that, if fails, do not fail all checks
Run each check asynchronously
https://github.com/ateliedocodigo/py-healthcheck/blob/develop/healthcheck/healthcheck.py#L94
Create a decorator @checker
in order to add checkers on other modules.
Note: keep in mind that this package supports
flask
endtornado
When I do EnvironmentDump().run()
on Windows, it fails:
def get_os(self):
return {'platform': sys.platform,
'name': os.name,
> 'uname': os.uname()}
E AttributeError: module 'os' has no attribute 'uname'
A guard against missing 'uname' attribute would be apt here
As of now only failures and exceptions are logged.
Could we also log passing tests with a low log level, e.g. using logger.debug
?
Run flake8 instead pep8 and pass all tests.
https://github.com/ateliedocodigo/py-healthcheck/blob/develop/tox.ini#L9
My FastAPI code snippet:
from healthcheck import HealthCheck
health = HealthCheck()
@app.get("/healthcheck", tags=["app"])
def healthcheck():
return health.run()
Here's what i've got.
[
"{\"hostname\": \"dd5a1ae108e5\", \"status\": \"success\", \"timestamp\": 1606506347.5475533, \"results\": []}",
200,
{
"Content-Type": "application/json"
}
]
How to valid it to JSON response?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.