-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include django-health-check #4428
Comments
I am new here, can you please tell me what should i check in the function? connection with database or what else? Or Can someone help me here. |
@akashverma0786 possibly create a flag in cookiecutter, include django healthcheck, and add the URL in the urls.py |
I think that's a pretty standard need when you need to deploy to prod, especially with Docker. One notable exception might be Heroku, maybe?
Agree, I don't think it's needed for local development. Side note, I wonder if the Celery checks would help resolve this old issue: #2727 |
@browniebroke I've been using this lib in production and with the recent change in how Sentry charges things, one of the pending tasks for my team is to exclude any logs generated by this lib from being sent to Sentry. I unfortunately haven't had time to work on it yet. |
It seems Heroku does not have some health check mechanism. #2727 Root cause is celery beat startup without the
However, it is overkilled and over-complicated IMO. It can be fixed by including |
I'm in for adding In my opinion Python is to slow for using it in aa healthcheck. 30s start-period is not something that is usable I think. I found this snippet a while ago but don't remember where. It checks if there is something running at port 5000 and perfectly suitable for rolling updates with docker swarm services. services:
django:
<<: *default-opts
command: /start
healthcheck:
test: /bin/bash -c "timeout 1 bash -c '</dev/tcp/localhost/5000' 2>/dev/null"
start_period: 100s
interval: 30s
timeout: 30s
retries: 5
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 24
rollback_config:
parallelism: 0
order: stop-first
update_config:
order: start-first
failure_action: rollback
delay: 10s |
Description
"health_check", "health_check.db"
to INSTALLED_APPS"health_check.cache"
to INSTALLED_APPS if cache enabledHEALTHCHECK --interval=5m --timeout=3s --start-period=30s --retries=3 CMD python ./manage.py health_check
Not really sure if this sure be included in dev docker image.
Rationale
In a live setup, we use health-checks to see if an app or container is working right. AWS Application Load Balancer (ALB) uses an HTTP call to check health. AWS Elastic Container Service (ECS) does a health-check with a built-in method or a custom script. Other platforms like Kubernetes do similar checks.
The text was updated successfully, but these errors were encountered: