Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Prerequisites
- A Foundry project with at least one agent.
- Trace data collected for the target agent. If you haven’t set up tracing yet, see Set up tracing in Microsoft Foundry.
- Access to the Application Insights resource connected to your project. For background, see Azure Monitor Application Insights.
- A Log Analytics reader role to view traces, insights, and visualizations in Foundry.
Use cases
| Scenario | How Trace Replay helps |
|---|---|
| Root cause analysis | Quickly identify failures or bottlenecks in agent conversations. |
| Token usage optimization | Spot spans with high token consumption to optimize agent prompts and reduce costs. |
| Debugging | Replay execution step-by-step to understand failures or unexpected behaviors. |
| Conversation reconstruction | Visualize the entire conversation flow for audits or reviews. |
Open the Replay Panel
- Sign in to Microsoft Foundry.
- Navigate to the Traces page under your agent.
- Select a Conversation ID or Trace ID to open the Replay Panel.
Explore the Replay Panel views
The Replay Panel provides two complementary views of a trace. To switch between them, select the Trajectories or User tab at the top of the Replay Panel. In both views, you can select any span to inspect the step in the agent loop, including LLM invocations, tool execution, user prompts, sub-agent orchestrations and responses. You can also view raw metadata as JSON and see the results of any evaluations that ran as part of this conversation.Trajectories view

User view

Filter traces

- In the Replay Panel, select the Filter control.
- Choose one or more span types from the list to narrow the trace.
| Filter | Shows |
|---|---|
| Chat | Chat-specific spans in the trace |
| Agent | Agent invocation |
| Tool | Any tool executions that occurred during the trace |
| Conversation | Conversation-specific spans in the trace |
Filter by token consumption
Filter spans by token usage level to identify hotspots or outliers.| Level | Description |
|---|---|
| Low | Less than 500 tokens |
| Medium | 500–2k tokens |
| High | More than 2k tokens — useful for identifying outliers in the trace loop |
Replay a conversation

- Select Play in the Playthrough control at the bottom of the Replay Panel.
-
Use the playback controls as needed:
- Skip spans at any point to jump ahead in the interaction.
- Adjust playback speed (for example, 1x, 2x, or 4x) to move through long traces faster.
- Scrub to any point in the trace using the timeline scrubber to seek directly to a specific moment without replaying from the beginning.
Troubleshoot
| Symptom | Resolution |
|---|---|
| Conversation ID or Trace ID isn’t visible | Tracing isn’t configured for this agent. See Set up tracing in Microsoft Foundry. |
| Replay Panel loads but shows no spans | The trace might still be processing. Wait a few minutes, then refresh the page. |
| Playthrough control is unavailable | Playthrough requires two or more spans. Single-span traces can’t be replayed sequentially. |
| Filter applied but no spans are visible | The selected filter type doesn’t appear in this trace. Clear the filter and try a broader span type, or verify that the agent uses the filtered capability. |