Repository navigation
Make OpenTelemetry export honor the protocol, correlate logs and traces, and tag chain spans. - #229
Merged
Merged
Conversation
Metrics now honor OTEL_EXPORTER_OTLP_PROTOCOL (grpc or http/protobuf), and the worker's own spans export through a tracer provider built per process. The images install the Redis, httpx, requests, logging and FastAPI instrumentations as pinned dependencies instead of a bootstrap step that could fail silently. JSON logs gain trace_id and span_id inside a span. The chain span gains tenant.id and call.session_id as span attributes only. OpenAI LLM instrumentation, when installed, hides prompt and reply content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chain span attributes now come from the vCon the link step already loads, only when an export endpoint is set, so there is no extra Redis or storage read. A worker flushes its tracer and meter providers when it returns, including after an error, since a forked worker never runs atexit. The tracer pid marker is set after the build under a lock, log trace ids appear only with an endpoint set, and the multi-worker parent no longer builds a provider its children would carry idle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he generated environment page. Forking the pytest process after other tests load gRPC crashed the child with SIGSEGV on macOS. The driver now forks from a clean process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
howethomas
force-pushed
the
o6-otel-fixes
branch
from
November 22, 2026 22:17
68ea869 to
aef6229
Compare
With the collector down, the SDK defaults held a worker's exit for up to a minute. Exporters get a 2 s timeout, and the tracer and meter shutdowns each run on a daemon thread with a 3 s and 2 s budget. The tracer provider no longer uses the SDK's own atexit hook, which could block for 30 s. 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>
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.
Makes turning on
OTEL_EXPORTER_OTLP_ENDPOINTsafe and useful. Nothing changes while the endpoint is empty.OTEL_EXPORTER_OTLP_PROTOCOL(grpcorhttp/protobuf, per-signal overrides too). Unset stays gRPC. Per-processservice.instance.id, the own-provider meter binding, theatexitflush and the per-vCon key filter are kept.vcon_processing.*,link.*,storage.*) export through a tracer provider built once per pid, like the meter provider, so forked workers get their own.Dockerfile,Dockerfile.apiandDockerfile.conserverno longer runopentelemetry-bootstrap ... || true. Redis, httpx, requests, logging and FastAPI instrumentations are pinned inpyproject.toml(uv.lockupdated), so a missing one fails the build.traceparentthrough the FastAPI instrumentation. A test covers it.trace_idandspan_idinside a span, through the OpenTelemetry logging instrumentation. Existing fields are unchanged.tenant.id(from thetenantattachment) andcall.session_id(from thetelnyx_call_session_idtag) as span attributes only. A test checks they are absent from metrics.docs/operations/monitoring.md,logging.md,.env.exampleand the generated environment reference are updated.Tests: new tests for metrics over http/protobuf (a real local OTLP/HTTP endpoint), protocol selection, per-pid tracer provider, traceparent, trace ids in a JSON record, and the span attributes. With Redis running, 740 passed, 17 skipped, 2 failed and 4 collection errors. The failures and errors are environmental on this host (
audioopmissing on Python 3.13, milvus and openai_transcribe dependencies not installed) and do not touch this change. Docker images were not built here.🤖 Generated with Claude Code