Repository navigation
Description
Summary
With otel.endpoint set, the Agent Substrate router exports its spans and joins the agent request trace, but the
egress gateway (atenet-egress) does not. The egress gateway still takes part in trace propagation: for every request
an Actor makes (model calls, MCP tool calls, TaskStoreService/UpdateTask back to the kagent controller) it records
a span id in its access log and forwards that span as the traceparent parent. Because that span is never exported,
every downstream span points at a parent that is not in the trace, and tracing backends mark the trace incomplete
(Jaeger: "parent span ID=… is not in the trace").
Versions
- Substrate chart and images: 1.0.0-rc2 (observed on a cluster); templates checked at
v1.0.0andv1.0.1 - kagent 1.0.0-rc2,
config.telemetry.tracesandconfig.runtimeDefaults.telemetry.tracesset - agentgateway v1.7.0 (the router and egress images)
Steps to reproduce
- Install kagent and Substrate with tracing on, as in the OTel stack guide:
--set otel.endpoint=http://<collector>:4317 --set otel.traces.samplingRatio=1.0on the substrate release, and the
kagenttelemetry.tracessettings. - Create a new Session for an Agent that calls a model and at least one MCP tool, and send it a message.
- Open the trace in Jaeger or Tempo.
Expected
One connected trace: kagent-controller → agentgateway (router) → agent runtime → (egress) → model / MCP server /
kagent-controller TaskStore, with every span's parent present.
Actual
The agent runtime's outgoing calls arrive at the next hop with a parent span that no service exported. Example from
one request (ids shortened):
- The kagent controller's server span
kagent.runtime.v1.TaskStoreService/UpdateTaskhas parent1ed54d12…, which
is not in the trace. - The
atenet-egressaccess log for the same call hashttp.path=/kagent.runtime.v1.TaskStoreService/UpdateTask trace.id=1ee334c6… span.id=1ed54d12…, so the missing parent is the egress gateway's own span. - The same happens for
POST /v1/chat/completionsand MCPtools/call/tools/listthat go through egress.
Cause
charts/substrate/templates/atenet-router.yaml renders a frontendPolicies.tracing block
(host: $AGENTGATEWAY_OTLP_TRACES_ADDRESS, randomSampling: {{ .Values.otel.traces.samplingRatio }}) and sets the
AGENTGATEWAY_OTLP_TRACES_ADDRESS / AGENTGATEWAY_OTLP_LOGS_ADDRESS env when substrate.otel.signalEndpoint returns
an endpoint. charts/substrate/templates/atenet-egress.yaml has neither, at v1.0.0 and v1.0.1. There is also no
value to add them (atenetEgress exposes only agentgateway.resources).
Proposed fix
Mirror the router in atenet-egress.yaml: when substrate.otel.signalEndpoint "traces" is non-empty, add
frontendPolicies.tracing with the same host and randomSampling, and set AGENTGATEWAY_OTLP_TRACES_ADDRESS (and
the logs address for the access log, if wanted) on the egress container. The egress gateway would then report as
agentgateway like the router, and agent traces would be complete.
Related: #64 (Helm values for settings that today need post-renderers).
Activity