Repository navigation
Closed
Copy link
Labels
Description
Summary
inference-gateway/cli#909 (closes inference-gateway/cli#904) makes subprocess and remote-agent tracing cooperative and open-standard. The propagation contract is user-facing and undocumented.
Behavior to document (all gated on telemetry.enabled: true):
- Env vars for subprocesses: the Bash tool (and therefore skill scripts) and headless subagents receive
TRACEPARENT/TRACESTATE(W3C Trace Context, parented on the currentexecute_toolspan) andBAGGAGE(W3C Baggage:infer.session.id,infer.tool.call.id). Nothing is set when telemetry is disabled. - Span reporting is standard OTLP, chosen automatically:
telemetry.otlp.endpointconfigured: the endpoint and headers are passed through to the child env (OTEL_EXPORTER_OTLP_ENDPOINT/OTEL_EXPORTER_OTLP_HEADERS) so child spans stitch in the remote backend.- No endpoint (the default): the CLI runs an ephemeral localhost OTLP/HTTP receiver per session and points children at it; received spans are persisted into the local per-session trace store and appear in
infer traces//tracesnested under the tool span.
- Any OTel-instrumented tool works with zero custom code. Example with otel-cli inside a Bash tool call:
otel-cli exec --name "go test" -- go test ./...The resulting span shows up as a child of execute_tool Bash in infer traces.
- Subagents:
infer agenthonors an inheritedTRACEPARENT, so a subagent session nests under the caller'sexecute_tool Agentspan - one cross-process trace:
session (standard, success) 152ms
|-- execute_tool Agent 89ms
| `-- session (readonly, success) 52ms
| `-- chat openai/gpt-4o 13ms
- Remote A2A agents: outbound A2A requests carry
traceparent/tracestate/baggageHTTP headers. Context-out only: remote spans stitch via a shared collector, not the local store. - Limitations worth stating: interactive (tmux-pane) subagents are not stitched; detached background shells that outlive the CLI lose late spans.
Affected pages:
- Telemetry/observability page: the propagation contract, the env vars, the local-first/remote-optional sink selection, the otel-cli and OTel SDK examples.
- Agent/subagent docs: cross-process trace nesting.
infer tracesreference (see [DOCS] Document infer traces command and /traces shortcut #390): mention that ingested child spans appear in the tree.
Source: inference-gateway/cli#909, inference-gateway/cli#904. Related: #390.
Acceptance Criteria
- The telemetry docs document
TRACEPARENT/TRACESTATE/BAGGAGEpropagation to subprocesses and the OTLP sink selection (configured endpoint passthrough vs local ephemeral receiver). - An otel-cli example and an OTel SDK note show third-party spans landing in
infer traces. - Subagent trace nesting and the A2A HTTP header propagation are documented, including the shared-collector requirement for remote spans.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Jul 14, 2026
@claude Can you work on this?
inference-gateway-maintainer commentedon Jul 14, 2026
Claude finished @edenreich's task in 10m 4s —— View job •
docs/issue-391-20260714-1200• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-391-20260714-1200?quick_pull=1&title=Issue%20%23391%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23391%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Done
Documented the W3C trace context propagation contract and OTLP span ingestion (from inference-gateway/cli#909) across the CLI and Observability docs.
TRACEPARENT/TRACESTATE/BAGGAGEpropagation + OTLP sink selection (CLI Telemetry)infer traces)infer tracesoutput showing ingested child spansPR: #394
What changed
cli.md(Telemetry reference - the authoritative CLI telemetry home):TRACEPARENT/TRACESTATE/BAGGAGEenv vars set for the Bash tool, skill scripts, and headless subagents (with a table), gated ontelemetry.enabled: true.telemetry.otlp.endpointpassthrough (OTEL_EXPORTER_OTLP_ENDPOINT/OTEL_EXPORTER_OTLP_HEADERS) vs. the default local ephemeral OTLP/HTTP receiver that persists child spans into the per-session trace store.otel-cli execexample plus an OTel SDK note showing third-party spans nest underexecute_tool Bashininfer traces.traceparent/tracestate/baggageHTTP headers with the shared-collector requirement for remote spans, and the tmux/detached-shell limitations.observability.md(CLI Telemetry section):Verification
bun run format:check,bun run lint:md, andbun run buildall pass. All new internal anchors resolve.Notes
cli.mdbecause that is the authoritative CLI telemetry reference (it also hostsinfer tracesand the Local Subagents docs), with a concise pointer summary on the Observability page. No provider-generated regions were touched.| Branch:
docs/issue-391-20260714-1200| PR #394inference-gateway-releaser commentedon Jul 18, 2026
🎉 This issue has been resolved in version 0.9.2 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀