---
title: "Inspect spans and traces"
subtitle: "Open a span, trace or thread to find what went wrong, then rerun it."
---

Select any row in [Logs](/docs/documentation/features/observe/explore-spans) to open it in a side panel. Read one model call, walk an agent run span by span, or read a whole conversation, then rerun the call to test a fix.

## Debug a request

<Steps>
<span data-docs-fragment-alias={"choose-the-right-level"} aria-hidden="true" data-pagefind-ignore="" style={{ display: "block", height: 0, scrollMarginTop: "5rem" }} />

<Step title="Open the row">

Go to **Observability** › **Logs** and pick a grouping in the filter row:

- **Spans** to see one call on its own.
- **Traces** to see the whole run it belonged to.
- **Threads** to see the conversation. See [Follow a session with threads](#follow-a-session-with-threads).

Click a row. The side panel opens on the right.

</Step>
<Step title="Read the span">

The header shows the span ID, its type and model, and the API key, customer ID, thread ID and custom properties the span recorded. If the span failed or has warnings, the error shows at the top.

<img src={"/docs/images/inspect-traces/span-panel-light.png"} width="620" className="block dark:hidden" alt="Span side panel for an anthropic.chat span, with Run, Assign to and the more menu, tags for model, API key, customer and thread, custom properties, and the Messages, Tools, Metrics, Metadata and Config tabs" />
<img src={"/docs/images/inspect-traces/span-panel-dark.png"} width="620" className="hidden dark:block" alt="Span side panel for an anthropic.chat span, with Run, Assign to and the more menu, tags for model, API key, customer and thread, custom properties, and the Messages, Tools, Metrics, Metadata and Config tabs" />

| Tab | What it shows |
|---|---|
| **Messages** | The input and output, including tool calls. Switch the view between **Pretty**, **Markdown**, **JSON** and **YAML**. Speech and transcription spans show **Audio** instead. |
| **Tools** | The tools sent with the request. |
| **Metrics** | **Tokens**, **Cost**, **Latency** and **Characters**. Click a row for its breakdown, such as cache reads or time to first token. [Behaviors](/docs/documentation/features/pulse/behaviors) that fired on the span are listed below. |
| **Metadata** | Identifiers and custom properties. |
| **Config** | **Generation settings**, **Advanced settings**, **Respan gateway config** and **Additional parameters**. |

**Messages** and **Metrics** show only when the span has data for them. To see the whole span as JSON or YAML, click **Open raw metadata** (the `{}` icon) in the toolbar. **Assign to** sends the span to one of your evaluators for review.

</Step>
<Step title="Walk the trace">

If the span is part of an agent or workflow run, click ⋯ › **Open in Traces**. Logs switches to the **Traces** grouping, filtered to that run. Click the row to open it.

<img src={"/docs/images/inspect-traces/trace-tree-light.png"} className="block dark:hidden" alt="Trace side panel with the trace ID in the toolbar and a support_agent workflow tree: classify_intent with an openai.chat call, and answer_question with a search_docs tool call and an anthropic.chat call, each with a bar on the timeline. The selected anthropic.chat span shows on the right under its span ID" />
<img src={"/docs/images/inspect-traces/trace-tree-dark.png"} className="hidden dark:block" alt="Trace side panel with the trace ID in the toolbar and a support_agent workflow tree: classify_intent with an openai.chat call, and answer_question with a search_docs tool call and an anthropic.chat call, each with a bar on the timeline. The selected anthropic.chat span shows on the right under its span ID" />

The toolbar shows the trace ID. The tree on the left lists every span in the run, with each child under the span that called it. The timeline next to it shows when each span started and how long it ran. Click a span to see it on the right, under its own span ID, in the **Span** (input and output) and **Metadata** tabs.

Above the tree, you can filter it by span type, show or hide each span's duration, tokens and cost, and turn the timeline on or off. In a narrow browser window, the tree shrinks to icons and the timeline hides.

<Tip>
For a slow run, start at the longest bar in the timeline. For a wrong answer, look for the earliest span with bad data, not the last span that shows the failure.
</Tip>

</Step>
<Step title="Jump to related views">

From a span, the ⋯ menu next to **Assign to** takes you to related data:

| Item | What it does |
|---|---|
| **Open in Traces** | Opens the span's trace in the **Traces** grouping. Shows when the span belongs to a trace. |
| **Open in Threads** | Opens the span's thread in the **Threads** grouping. Shows when the span has a thread ID. |
| **Filter by cache key** | Filters Logs to spans with the same cache key. Shows when the span has one. |
| **Show nearby requests** | Clears your filters and sets the time range to the second around the span, so you see what else ran at that moment. |

</Step>
<Step title="Rerun the call">

On a chat span's **Messages** tab, the **Output** header has two rerun buttons:

- **Rerun** followed by the model name sends the same input to the same model again.
- **Other** sends it to a model you pick.

Each run is added next to **Original**, so you can compare the outputs. To try a follow-up turn, type it in **Continue conversation...** and click **Run**.

<img src={"/docs/images/inspect-traces/rerun-output-light.png"} width="620" className="block dark:hidden" alt="The Output section of a span, with the Rerun claude-sonnet-4-5-20250929 and Other buttons above the assistant reply" />
<img src={"/docs/images/inspect-traces/rerun-output-dark.png"} width="620" className="hidden dark:block" alt="The Output section of a span, with the Rerun claude-sonnet-4-5-20250929 and Other buttons above the assistant reply" />

To edit the prompt, tools or settings first, click **Run** in the header, or press P. Respan opens the span in a new playground with its messages, model and settings. See [Playground](/docs/documentation/features/prompt-management/playground).

To keep the prompt for reuse, click ⋯ › **Save as Prompt**.

The trace panel has no **Run** button. To rerun a call from a trace, click the span, then click **Open in Spans** (the arrow next to its ID). A new tab opens Logs in the **Spans** grouping, filtered to that span.

</Step>
</Steps>

## Follow a session with threads

A thread is every span that shares a `thread_identifier`, in time order. It can cover several traces. To group your spans this way, send `thread_identifier` with each span. See [Custom IDs & attributes](/docs/documentation/features/observe/custom-ids).

Switch the grouping to **Threads** and click a row. The panel has two tabs: **Messages**, the conversation so far, and **Metadata**, the thread's identifiers and properties.

<img src={"/docs/images/inspect-traces/thread-panel-light.png"} width="620" className="block dark:hidden" alt="Thread side panel showing a support conversation: the system prompt, the user's first question, the assistant's reply, and the user's follow-up" />
<img src={"/docs/images/inspect-traces/thread-panel-dark.png"} width="620" className="hidden dark:block" alt="Thread side panel showing a support conversation: the system prompt, the user's first question, the assistant's reply, and the user's follow-up" />

To dig into one turn, switch to **Traces** and filter by **Thread ID**, then open the trace where things went wrong.

## Share a span, trace or thread

Click the copy icon next to an ID:

- **Span:** **Copy ID**, **Copy URL**, **Copy title**, **Copy title as link**, **Copy input messages** (**Copy all** or **Copy without base64**), **Copy output messages**, **Copy timestamp** and **Copy model name**.
- **Trace:** next to the trace ID in the toolbar, **Copy ID**, **Copy trace URL** and **Copy title as link**. Next to the selected span's ID, **Copy ID**, **Copy span URL** and **Copy title as link**.
- **Thread:** **Copy ID**, **Copy URL**, **Copy title** and **Copy title as link**.

A copied URL opens Logs filtered to the same item. **Open in new tab** in the toolbar opens that URL for you.

## Keyboard shortcuts

| Shortcut | Action |
|---|---|
| ↑ / ↓ | Previous or next row. In a trace, previous or next span; past the first or last span, the previous or next trace. |
| ← / → | Switch tabs |
| J | Toggle the JSON view of **Messages** |
| P | Open the span or thread in the Playground |
| T | In a span, open it in a new tab. In a trace, show or hide the timeline. |
| ⌘ \ (Ctrl \ on Windows) | Full screen |
| Esc | Close the panel |

## Troubleshooting

### No traces appear

Check the environment and time range, then clear your filters. If the request still isn't there, your app may not be sending traces yet. Follow the [Tracing quickstart](/docs/documentation/features/tracing/quickstart) or set up an [integration](/docs/integrations/overview).

### A run shows up as separate traces

Model calls show up as separate traces when your app doesn't create a parent span around them. Wrap the run in a parent span, for example with the SDK's `@workflow` and `@task` decorators, or use a framework [integration](/docs/integrations/overview).

### Messages are empty

Some span types don't record messages. Check **Metadata** and **Config** instead. If logging is turned off for your organization, or with `disable_log` on the request, Respan doesn't store message content. **Messages** and **Tools** stay empty, and **Run** and the rerun buttons are off.
