Repository navigation
PR 1: telemetry with OpenTelemetry and Dash0 - #3
Conversation
- Traces, metrics and logs over OTLP/HTTP; export only when the endpoint is set - Every API request traced; the Elasticsearch 9 client traces its own calls as child spans - .env loaded into the process environment so the OTLP exporters see OTEL_* - Demo-only POST /api/debug/break (off by default) triggers a real Elasticsearch error - Dash0 web SDK: page views, web vitals, fetch and errors, trace header on /api calls - One .env at the repo root for both halves; only VITE_* reaches the browser - Telemetry section and first key decisions in docs/architecture.md
The first resolve downgraded FastAPI (0.162.2 -> 0.141.1) and the OTel API (1.45.2 -> 1.43.0) instead of moving the instrumentation to 0.66b2. Add version floors so it cannot slip back, and switch to the logging handler from opentelemetry-instrumentation-logging, since the SDK one is deprecated.
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · API and browser telemetry exports traces, logs, fetches, and errors to Dash0, which could expose sensitive request details. Adds OpenTelemetry tracing, metrics and logs to the FastAPI API with OTLP/HTTP export gated on ✅ 1 closed✅ Quality: Lockfile quietly downgrades FastAPI 0.162.2→0.141.1 and OTel API
VerificationRules No rules evaluated Functional validation Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Telemetry from the first hour (see docs/plan.md, row 1). Design notes are in docs/architecture.md.
What
OTEL_EXPORTER_OTLP_ENDPOINTis set, so tests and fresh clones run without a backend..envloaded into the process environment because the OTLP exporters readOTEL_*from there, not from app settings.POST /api/debug/break(demo only, off unlessENABLE_DEBUG_ENDPOINTS=true): sends Elasticsearch a query it rejects, so Dash0 has a real error to find./apicalls are same-origin, so the trace header joins the browser and API spans into one trace. The browser token is ingest-only.Verified locally
/v1/tracesand/v1/logsreturned 200.SUCCESS; traces for/api/healthand the failing/api/debug/break(with the Elasticsearchsearchspan and its exception) visible in Dash0.LLM spans (tokens and cost) arrive with the first LLM call in PR 8.