devilry / devilry-django

Devilry project main repository
http://devilry.org
BSD 3-Clause "New" or "Revised" License
51 stars 24 forks source link

Health check endpoint #1261

Closed torgeirl closed 1 year ago

torgeirl commented 1 year ago

When hosting Devilry as a service in a container orchestration environment, the service will need to answer health checks quite often. Doing these against the / endpoint will clutter the access logs. A better approach is to have a dedicated endpoint, i.e. /health. This way, the production environment can use a logging.Filter to do disable access logging for /health endpoint so it never enters the logging infrastructure (ELK, etc).

Python packages such as django-health-check and django-heartbeat offers a lot of extra functionality while I believe we only need the bare minimum:

Since this could run a few times per minute per pod the database test should be as simple as possible to keep it fast. If OK, it only needs to return a simple HTTP 200.