feat(deploy): log one access line per request to stdout

Each gunicorn service (edge, fetcher, generator) now writes a request line
("GET /x HTTP/1.1" 200 12ms) to stdout, which Pantheos ingests for request
logs and rps / 5xx / p95. /metrics and /health are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shay
2026-10-09 10:50:32 -04:00
co-authored by Claude Opus 5.5
parent 02e7270440
commit 74a8146779
6 changed files with 69 additions and 0 deletions
+1
View File
@@ -4,6 +4,7 @@ WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY src ./src
COPY gunicorn.conf.py ./
EXPOSE 5003
# Bind to $PORT when set (e.g. Cloud Run injects PORT=8080); default to 5003.
+22
View File
@@ -0,0 +1,22 @@
"""Gunicorn settings: one access line per request on stdout, for Pantheos.
Docker's json-file driver captures stdout and Pantheos ingests it, so each line
becomes a request log and feeds the container's rps / 5xx / p95. Monitoring
traffic (/metrics scrapes, /health checks) is left out so it doesn't drown the
real requests.
"""
from gunicorn import glogging
accesslog = "-"
access_log_format = '"%(r)s" %(s)s %(M)sms'
_QUIET_PATHS = ("/metrics", "/health")
class _Logger(glogging.Logger):
def access(self, resp, req, environ, request_time):
if req.path not in _QUIET_PATHS:
super().access(resp, req, environ, request_time)
logger_class = _Logger