Skip to content

fix(runtime,builder): health probes are not access-log traffic - #99

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
fix/probe-hits-are-not-access-log
Oct 21, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
fix/probe-hits-are-not-access-log

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

What

A kubelet asks /healthz and /readyz every few seconds for the life of a pod, and uvicorn's access log writes one line per answer. On obin-staging the model service logged 180 such lines per pod every ten minutes, all 200 OK, shipped to SigNoz as if they were requests. The trace of a real request already carries what an access line says; a probe hit says nothing anyone reads.

Fix, at the emitter

The agent hands uvicorn a logging configuration — uvicorn's own default (uvicorn.config.LOGGING_CONFIG) restated whole, with one filters: [probes] on the access handler — and the filter's module codefly_uvicorn_logging.py (ProbeFilter: drops an access record whose request path is exactly /healthz|/readyz|/livez|/health|/ready|/live|/ping, query stripped; everything else passes). Both files are written in the two places a service runs:

  • native run: beside the project before every start (writeUvicornLogging(s.Service.SourceLocation); uv run uvicorn puts the working directory on sys.path), --log-config uvicorn-log-config.json on the command line; the scaffold's .gitignore names both files;
  • image: rendered into the build context after the templates, COPY'd beside the code, and in the CMD.

A service that configures its own logging is untouched: --log-config shapes uvicorn's loggers only.

Tests

TestUvicornLoggingDropsProbesAndNothingElse: the configuration names the filter on the access handler only, restates every default logger, the module defines ProbeFilter, the path pattern matches the seven probe paths and nothing adjacent (/healthz/deep, /api/health-report, /pingback), and both files are rewritten whole. TestUvicornArgsReloadIsConditional carries --log-config. go test ./... green.

Not verified: a container built by this agent on a cell; next on obin-staging when the model service rebuilds on the released agent.

🤖 Generated with Claude Code

A kubelet asks /healthz and /readyz every few seconds for the life of a pod and uvicorn's access log wrote one line per answer — 180 lines per pod every ten minutes on a cell, all "200 OK", shipped to the telemetry store as if they were requests. The agent now hands uvicorn a logging configuration (uvicorn's own default with one filter on the access handler) and the filter's module, in both places a service runs: written beside the project for a native run and copied into the image by the builder. A service that configures its own logging is untouched; every non-probe line is written exactly as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte merged commit 1e51763 into main Oct 21, 2026
2 of 4 checks passed
antoinetoussaint-byte added a commit that referenced this pull request Oct 21, 2026
… where the build context is (#100)

#99 wrote uvicorn-log-config.json and codefly_uvicorn_logging.py into the render directory and COPY'd them from the context root; the build context is the service directory (or the assembled copy of it), so every image build failed at that COPY. They are now written into the project before any context is assembled — exactly where a native start writes them — and copied from code/ beside src.

Co-authored-by: Antoine Toussaint <312536060+antoinetoussaint-byte@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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