You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Sergey Zhuplev da2de7c5ab Update 'aiohttp_healthchecker/checker.py' 2 months ago
aiohttp_healthchecker Update 'aiohttp_healthchecker/checker.py' 2 months ago
.gitignore Initial commit 2 months ago
README.md Update 'README.md' 2 months ago
poetry.lock Initial commit 2 months ago
pyproject.toml Fix typo 2 months ago

README.md

aiohttp_healthchecker

Installation

$ pipenv install git+https://git.brandquad.ru/common/aiohttp_healthchecker.git@0.1.0#egg=aiohttp_healthchecker

Usage

async def test1(app):
    # check something
    return True, None


async def test2(app):
    # check something
    return False, "its not okey"

health_checker = HealthChecker()
health_checker.add_readiness_check(test1)
# Be aware with liveness probes! Do not check connectivity to external services (db, redis, etc)
# in liveness probes it can produce cascade restarts of application in case of temporary
# unavailable external service
health_checker.add_liveness_check(test2) 

# place this middleware on top of others, but after APM-like middlewares
# to trace probe transactions
app = web.Application(middlewares=[health_checker.build_middleware(), ...])