Skip to content

fix(logging): suppress successful health-probe access logs across all services - #131

Merged
Fidasek009 merged 1 commit into
masterfrom
fix/consistent-health-log-suppression
Aug 12, 2026
Merged

fix(logging): suppress successful health-probe access logs across all services#131
Fidasek009 merged 1 commit into
masterfrom
fix/consistent-health-log-suppression

Conversation

@Fidasek009

Copy link
Copy Markdown
Collaborator

Summary

All four HTTP services now consistently suppress successful /health access logs. MDRun API already had a Gunicorn HealthCheckFilter; the other three services lacked an equivalent filter and were flooding stdout every 30s probe cycle.

  • Gunicorn services (Dashboard API, Auth, MDRun API): share an identical gunicorn_logging.py wired via --logger-class. Suffix-based path match (endswith("/health")) works across all route prefixes.
  • Tuner (uvicorn): equivalent logging.Filter in api/access_logging.py, wired into LOGGING_CONFIG.
  • Simplified the mdrun-api filter: dropped _get_status_code helper and HTTP_SUCCESS_MIN/HTTP_REDIRECT_MIN constants — status == "200" is the precise check since every health endpoint returns exactly 200. Failed probes (500 etc.) and non-health requests remain logged.
  • Removed the auth _first_health_logged per-request workaround that compensated for the missing filter.

Verification

  • make fix, make type-check, make test — all green (746 tests).
  • Images pushed (dev tag) for all four services. MDRun API and Tuner pods restarted in krasa-ns and 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).

… 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>
@Fidasek009
Fidasek009 merged commit 70692a3 into master Aug 12, 2026
12 checks passed
@Fidasek009
Fidasek009 deleted the fix/consistent-health-log-suppression branch August 12, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant