refactor(worker): trim observability helper docstring; clarify test fake

- Collapse _init_worker_observability's docstring to one line; the WHY moves
  to a concise inline comment (per review).
- Note that _fake_settings.ingest_queue is unused by the helper (test realism).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-11 05:45:47 +02:00
co-authored by Claude Opus 4.8
parent eab090f351
commit 6aa4b3f7b7
2 changed files with 4 additions and 11 deletions
+3 -10
View File
@@ -291,16 +291,9 @@ def run(
def _init_worker_observability(settings: Settings) -> None:
"""Configure logging, metrics, and tracing for the ingest worker.
Mirrors the observability bootstrap the API pod performs in its lifespan
(``app.py``), but for the standalone ``worker`` entrypoint which never runs
uvicorn. Without this the worker emits plain-text logs and serves no
``/metrics`` endpoint, so the astrolabe_* document-pipeline metrics and the
``document_processor.parse`` spans (recorded in the shared registry/processor
code the worker executes) stay invisible in external split-worker mode
(Deck #310 / #175).
"""
"""Configure logging, metrics, and tracing for the standalone ingest worker."""
# Mirrors app.py's lifespan bootstrap; without it the worker's astrolabe_*
# metrics and document_processor.parse spans are invisible in external mode.
# Structured logging first, so every subsequent startup line is JSON like
# the API's — the worker entrypoint never went through uvicorn's log_config.
setup_logging(
+1 -1
View File
@@ -339,7 +339,7 @@ def _fake_settings(**overrides):
real Settings.__post_init__ validation/derivation.
"""
base = dict(
ingest_queue="postgres",
ingest_queue="postgres", # for realism / worker() gating; unused by the helper
log_format="json",
log_level="INFO",
log_include_trace_context=True,