Skip to content
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

(BSR)[API] fix: Restore Gunicorn "pre request" logs #12897

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

dbaty
Copy link
Contributor

@dbaty dbaty commented Jun 24, 2024

Registering our own handler replaces the default Gunicorn handler,
which logs the start of the request, like this:

[634677] [DEBUG] GET /health/api

... which is useful to analyze SIGKILL sent to Gunicorn workers (see
PC-27885 for an helper script).


Testé en local en lançant Gunicorn comme suit :

$ ENABLE_FLASK_PROMETHEUS_EXPORTER=1 PROMETHEUS_MULTIPROC_DIR=/tmp/pass-culture-prometheus GUNICORN_PORT=4999 GUNICORN_MAX_REQUESTS=10 GUNICORN_MAX_REQUESTS_JITTER=10 GUNICORN_WORKERS=2 GUNICORN_THREADS=2 GUNICORN_TIMEOUT=10 GUNICORN_LOG_LEVEL=debug ./entrypoint.sh
[...]
[2024-06-24 09:52:28 +0200] [634677] [DEBUG] GET /health/api

Registering our own handler replaces the default Gunicorn handler,
which logs the start of the request, like this:

    [634677] [DEBUG] GET /health/api

... which is useful to analyze SIGKILL sent to Gunicorn workers (see
PC-27885 for an helper script).
@dbaty dbaty force-pushed the dbaty/restore_pre_request_gunicorn_logs branch from 7bc6360 to 5ada532 Compare June 26, 2024 13:35
@dbaty dbaty merged commit 5ada532 into master Jun 26, 2024
@dbaty dbaty deleted the dbaty/restore_pre_request_gunicorn_logs branch June 26, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants