feat(observability): add OTEL traces and logs to harnesses (#2805)
Adds correlated OpenTelemetry tracing and logging across the Kagent, Codex, and Claude harnesses. Refactors shared tracing configuration and setup code. Builds on top of previous V2 observability works like #2663 and #2786. Also closes #2760 and partially addresses #2762. ### Key Changes - Resolve and validate OTLP trace and log settings consistently across all harness compilers. - Propagate telemetry configuration, service identity, and collector egress into runtime revisions. - Configure Codex and Claude native trace and log exporters with content capture enabled. - Propagate W3C trace context through Codex JSON-RPC requests and Claude process environment. - Initialize shared Go tracing in the native harness wrappers and move common tracing code out of the ADK package. - Flush request spans before terminal and input-required events cause an Actor to pause. ### Notes - Traces and logs are independently enabled through `OTEL_TRACING_ENABLED` and `OTEL_LOGGING_ENABLED` - Invalid or missing enabled-signal endpoints and unsupported protocols now fail harness compilation. - Span attributes for Claude Code is [documented here](https://code.claude.com/docs/en/monitoring-usage#span-attributes) and available events / logs is [documented here](https://code.claude.com/docs/en/monitoring-usage#events) - Events / logs emitted by Codex is [documented here](https://learn.chatgpt.com/docs/config-file/config-advanced#what-gets-emitted). There is no official docs for Codex's span hierarchy and attributes - Codex and Claude Code force flushes traces when their process exists before the gateway Suspends the instance. The adapter process will also flush its own traces before it responds with a terminal event as per the changes in `go/adk/pkg/a2a/server/server.go`. However, during a pending HITL, since we do not quit the Codex or Claude process, it is not guaranteed that all traces are delivered immediately. - For both Codex and Claude, native spans after HITL completes remain in the original request trace because the in-flight process carries the same trace context (through env var or JSON-RPC). The resume A2A trace may contain only controller and Go wrapper spans. --------- Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
J
Jet Chiang committed
ff607686c80e9c5e4b951fd365dd68abb43dbdc2
Parent: bb0cba6
Committed by GitHub <noreply@github.com>
on 9/16/2026, 3:06:39 PM