fix(logging): suppress successful health-probe access logs across all services - #131
Merged
Merged
Conversation
… services Dashboard API, Auth, and Tuner were logging every 30s health probe to stdout. MDRun API already suppressed these via a Gunicorn logger class; the other three services lacked an equivalent filter. - Share an identical gunicorn_logging.py (HealthCheckFilter) across the three Gunicorn services, wired via --logger-class. Match is suffix-based so it works across all route prefixes (/health, /api/health, /dash/api/health). - Add the equivalent uvicorn logging.Filter (tuner/api/access_logging.py) wired into LOGGING_CONFIG. - Simplify the mdrun-api filter: drop the _get_status_code helper and HTTP_SUCCESS_MIN/REDIRECT constants; status == "200" is the precise check since all health endpoints return exactly 200. - Remove the auth _first_health_logged workaround that compensated for the missing filter. Co-Authored-By: glm-5.2 <noreply@einfra.cz>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All four HTTP services now consistently suppress successful
/healthaccess logs. MDRun API already had a GunicornHealthCheckFilter; the other three services lacked an equivalent filter and were flooding stdout every 30s probe cycle.gunicorn_logging.pywired via--logger-class. Suffix-based path match (endswith("/health")) works across all route prefixes.logging.Filterinapi/access_logging.py, wired intoLOGGING_CONFIG._get_status_codehelper andHTTP_SUCCESS_MIN/HTTP_REDIRECT_MINconstants —status == "200"is the precise check since every health endpoint returns exactly 200. Failed probes (500 etc.) and non-health requests remain logged._first_health_loggedper-request workaround that compensated for the missing filter.Verification
make fix,make type-check,make test— all green (746 tests).devtag) for all four services. MDRun API and Tuner pods restarted inkrasa-nsand live-verified: 200 health probes produce no access log; non-health requests (404/401) are still logged. Dashboard API/Auth sidecars use byte-identical filter modules and the same gunicorn flag (verified on next user pod spawn).