Skip to main content
Group multiple LLM calls — or an entire agent-to-agent chain — under one distributed trace by propagating the W3C Trace Context traceparent header through the gateway. Every request that shares a trace_id appears as a single trace in your observability backend — the whole chain on one ticket.

How the gateway propagates traces

  1. Your application sends a request with a traceparent header.
  2. The gateway extracts the trace context and creates its HTTP and GenAI spans as children of that trace.
  3. The gateway injects traceparent into the upstream provider request, so the application, gateway, and provider share one trace ID.
  4. The gateway returns traceparent in the response headers so your application can continue the trace.

Group multiple LLM calls under one trace

If your application uses the OpenTelemetry SDK, wrap multiple gateway calls in a single span. The OTel HTTP instrumentation automatically propagates the traceparent header.
Both LLM calls appear as children of the summarize-document span in your trace viewer.

Agent-to-agent tracing

When one agent delegates to another, pass the traceparent through to maintain a single end-to-end trace:
All four LLM calls land in the same trace, giving end-to-end visibility across agents.
To enrich these traces with session metadata or client-side operation context (tool execution, retrieval, agent steps), see Context Propagation.

Manual traceparent without an OTel SDK

If you don’t use an OpenTelemetry SDK, you can still pass a traceparent header manually. The format is:
For example:
Both requests share the same trace_id and appear in one trace. To chain further calls, read the traceparent header from each gateway response — it carries the gateway’s own span ID — and forward it as the parent of the next request.