﻿# How do you connect gateway calls to an agent trace?

LiteLLM v1.113.0-dev.1 adds correlation of agent spans and gateway calls in Lens. Validate the trace graph and its data fields independently.

Author: Retrivium editorial team
Updated: 2026-11-28
Canonical URL: https://retrivium.ai/journal/daily-20261128-agents-litellm-lens-span-correlation/
Language: en

An agent turn can spend time in tool coordination, model calls and retries. A gateway only sees the requests that cross it. The LiteLLM v1.113.0-dev.1 prerelease, published on 26 November, lists forwarding agent spans to Lens and recording gateway calls in the agent trace. The release also lists removal of agent-harness context from what the gateway sends to Lens. Both changes are described in upstream pull requests. The dev tag is a preview of behavior that merits testing with the same version you intend to use.

## Reconstruct one turn from parent to leaves

Use a synthetic task with two parallel model calls, a tool span and one intentional retry. Make sure the top-level turn has a stable trace ID and that each attempted call appears under the intended parent. A retry should have its own attempt identifier while belonging to the original turn. If two parallel calls appear as unrelated traces, a slow turn could look like a model problem even when the lost time is elsewhere.

## Review the fields at the forwarding boundary

Trace identity can be useful without including full input, output or tool arguments. Inspect the emitted data with harmless fixture values and confirm that fields removed by your policy are absent. Check destination, viewers and retention as separate settings. Any fields the release strips in one forwarder path still need verification if your app sends information through another exporter.

## Measure decisions the trace can support

Compare the overall turn duration with the critical path through its children. Parallel spans can overlap, so adding all durations overstates elapsed time. Review when time is spent waiting for a model, waiting for a tool or repeating work. Define a pass criterion that ties span completeness to a useful operational question, such as which model attempt delayed the answer.

## Treat missing spans as missing evidence

A span can arrive late, be sampled out, or fail to reach its destination while the request still succeeds. Record the expected and observed span counts for the fixture and repeat the check after a forwarding failure followed by recovery. A dashboard should distinguish a truly absent stage from a missing measurement. In a production rollout, set a coverage threshold before using the trace to justify moving traffic across models.

## Sources

- [Primary source · litellm v1.113.0-dev.1](https://github.com/BerriAI/litellm/releases/tag/v1.113.0-dev.1)
- [Primary source · litellm #53285](https://github.com/BerriAI/litellm/pull/53285)
- [Primary source · litellm #53226](https://github.com/BerriAI/litellm/pull/53226)

## Related reading

- [Related guide · Llm perf agent trace replay cache evidence](/journal/llm-perf-agent-trace-replay-cache-evidence/)
- [Related guide · Frontier swarm single agent evaluation control](/journal/frontier-swarm-single-agent-evaluation-control/)
