---
updatedAt: 2026-11-04T17:24:52.000Z
agentTools:
  projectIndex: https://docs.getmontecarlo.com/llms.txt
---

# Trace and Conversation Structure

What a trace contains, how to read one, and how traces relate to conversations.

Every agent run is captured as a **trace**, and every multi-turn exchange as a **conversation**. They're the evidence behind everything else in Agent Trust: monitors alert on them, [Conversation Clusters](https://docs.getmontecarlo.com/docs/conversation-clustering) group them, and [Reinforcement Loop](https://docs.getmontecarlo.com/docs/reinforcement-loop) cites them in every finding. This page covers how to find, read, and export them when you want to dig in yourself.

## Find the trace you need

Start from the **Agent summary** to see where an agent is degrading — trace count, latency percentiles, token usage, and error rates over a time range, segmentable by workflow, task, or model.

Then drill into the **Trace Explorer**, which lists every trace with its status, duration, token usage, and error state.

* **Search on your own metadata.** Use `key:value` on any attribute your agent emits, plus built-in fields. Prefix with `-` to exclude, quote values with spaces, and chain with `AND`.
* **Filter on errors two ways.** *Final error state* shows runs that ultimately failed. *Has errors anywhere* also catches runs that hit an error mid-flight and recovered — the ones an "OK" status would hide.
* **Compare side by side.** Use the open-in-new-tab icon on a trace row to open several traces without losing your filtered view.
  <Callout icon="📘" theme="info">
    Custom-metadata search is available for OTel agents on the [Agent Observability Data Platform](https://docs.getmontecarlo.com/docs/ao-platform-overview).
  </Callout>

## Read a trace

A trace is a tree of **spans**, each one unit of work. Click any span to see its inputs, outputs, timing, and metadata.

| Span type       | What it captures                                                              |
| --------------- | ----------------------------------------------------------------------------- |
| **LLM span**    | Prompt, completion, model name, token counts, latency                         |
| **Tool span**   | Tool name, the inputs the agent passed, the response that came back, duration |
| **Custom span** | Any step your agent instruments                                               |

Every span also carries timing, status, and any custom attributes you emit, like ticket IDs or customer names.

Start with tool spans. They show what the agent actually *did* — queried a table, called an API, ran a function — and what it got back, which is usually where the problem is.

Don't want to walk the span tree? **Explain this trace** gives you a plain-English summary of what the agent did, ready to share.

## Read a conversation

Chat-style agents produce one trace per user turn. The conversation view stitches them into a single dialogue, so you can follow the back-and-forth without jumping between traces.

* Messages appear in order, labeled user, agent, system, or tool. Tool messages include the tool name, inputs, output, and duration.
* Click any message to jump to the span behind it.
* **Explain this conversation** summarizes the whole exchange.
* **Evaluate on demand.** Run an evaluation on any conversation — pick from the standard set or write your own prompt — and get results in seconds, no monitor needed. Use it to check "did the agent do the right thing here?" or to test an eval before turning it into an [Agent Evaluation Monitor](https://docs.getmontecarlo.com/docs/agent-evaluation-monitors).

Traces are grouped into a conversation by a shared conversation ID. For OpenTelemetry agents, set `gen_ai.conversation.id` on every span — see [OpenTelemetry Integration](https://docs.getmontecarlo.com/docs/opentelemetry-integration#3-group-conversations-and-tag-workflows).

## Errors

An agent's status reflects its final outcome. Errors that happened mid-run are tracked separately, so a run that recovered still shows what went wrong. Error counts match across the trace list, agent summary, dashboards, and conversations.

To get alerted when error rates rise, use an [Agent Metric Monitor](https://docs.getmontecarlo.com/docs/agent-metric-monitors) on error rate.

## Export traces

Turn real production runs into eval sets, fine-tuning data, or offline repro cases.

* **Selected spans as JSONL.** From a trace, select the LLM spans you want and export them — one record per span, with input, output, tool calls, and model content.
* **A full trace.** Use **Export trace** in the UI, or the CLI, to get a gzipped JSON of the whole span tree with per-span content:

```shell
montecarlo agent-traces export --trace-link <copy-link-from-UI>
```

## Related

* [Reinforcement Loop](https://docs.getmontecarlo.com/docs/reinforcement-loop) — turns production agent traces into evidence-backed findings, diagnosed causes, and fixes you can act on.
* [Conversation Clusters](https://docs.getmontecarlo.com/docs/conversation-clustering) — see what users ask and where your agent fails.
* [OpenTelemetry Integration](https://docs.getmontecarlo.com/docs/opentelemetry-integration) — send traces from any agent.
* [Agent Trust overview](https://docs.getmontecarlo.com/docs/agent-monitors-overview) — how it all fits together.