Repository navigation
feat: ship API and worker logs to ClickHouse over OTLP [#241] - #44
Merged
Merged
Conversation
Root-logger INFO+ lines go to an OTLP collector when OTEL_EXPORTER_OTLP_ENDPOINT is set; a local collector and ClickHouse run under the compose `observability` profile. See ADR 0007. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Default service.name to knowledge-provider when OTEL_SERVICE_NAME is unset - Cap export at 5s so shutdown with the collector down fits Docker's stop grace - Keep operator emails out of shipped logs: /search logs user id, email-OTP lines move to a logger that is not exported - Let env_file carry OTEL_EXPORTER_OTLP_ENDPOINT instead of a compose override - Test provider ownership and the API/worker wiring Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Operator identity is fine to ship; restore user.username/email on /search lines and export email-OTP lines again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hariharanweb
force-pushed
the
feat/241-logs-to-clickhouse
branch
from
November 5, 2026 10:25
3b316e9 to
c295e34
Compare
- Request middleware: method, URI with query, status, duration; error detail on non-2xx, traceback on unhandled exceptions; no bodies - Worker interceptor logs every activity's start, completion or failure - API and worker startup messages are log lines instead of prints Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Request logging is pure ASGI: streamed responses timed to the last byte, mid-stream failures logged; 5xx at ERROR with the caught cause; 429 and reason-phrase fallback for missing detail; /health at DEBUG - Temporal interceptor also logs workflows, and cancellations of both; activity failures at WARNING (Temporal logs the traceback) - Log API startup failures and worker crashes, then flush - Log the three vector-delete handlers that swallowed exceptions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tarannum-2002
approved these changes
Nov 11, 2026
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.
Part of OpenAgriNet/engineering-tracker#241.
What
pipeline/observability.py: whenOTEL_EXPORTER_OTLP_ENDPOINTis set, root-loggerINFO+ lines from the API and worker go over OTLP/HTTP. No-op when unset.main()(flushed on shutdown).otel-collector+clickhouseunder compose profileobservability; a plaindocker compose upis unchanged./healthat DEBUG.OTEL_SERVICE_NAMEset per service (knowledge-provider-api/-worker)..env.example,ENV.md,README.md,AGENTS.md, ADR 0007.Decisions
/searchquery text and payload are kept (no allowlist, unlike DSS).service.namedefaults toknowledge-provider; exports give up after 5s so shutdown fits Docker's stop grace.OTEL_*env vars; helm wiring is not in this PR./searchlogs go in the next story, once callers send them.Verification
uv run ruff check .clean;uv run pytest -m "not slow"747 passed (new:tests/test_observability.py,tests/test_observability_wiring.py)./searchlines (with query text) and worker lines land inotel.otel_logs; DEBUG not shipped./searchstill returns 200.🤖 Generated with Claude Code