Tracing

Route: Observations → Tracing (/observations/tracing)

Analytics tell you that something changed. Tracing tells you what actually happened on one specific request. This is the deepest view in TrailAI.

Trace list


The trace list

One row per trace, newest first. Columns can be shown or hidden — the defaults cover:

Column Meaning
ID Trace identifier. Click to copy; it's what you paste into a bug report
Name The root operation — a provider method, or your decorated function's name
Kind Span kind: llm, agent, tool, memory, external, function
Time When the trace started
Duration End-to-end latency
Model The model used, where applicable
Provider OpenAI, Anthropic, Cohere, …
Tokens Prompt / completion / total
Cost Computed cost for the trace
Application service.name from trail.init()
Environment deployment.environment from trail.init()
Status Success or error

Use column visibility to build the view you need — hide token columns when debugging latency, hide duration when auditing cost.


Filtering

Trace filters

Filters combine — every one you set applies simultaneously, on top of the time range.

Filter Use it to
Time range Scope to the window you care about. Always set this first
Application Isolate one service in a multi-app project
Environment Separate production from staging
Model / Provider Compare behaviour across models
Span kind Show only agent runs, or only tool calls
Status Errors only — the fastest path to a problem
Search Free-text match against trace content

Below the table you'll find pagination, page size, and a refresh rate control for live tailing. Turn auto-refresh off while reading a specific trace, or the list will move under you.


Trace detail

Click any row.

Trace detail

Three regions:

  1. Header — trace ID, total duration, total cost, status, application, environment.
  2. Span tree / waterfall — the hierarchy of spans with their relative timings.
  3. Span detail — everything recorded on the currently selected span.

The page scrolls independently, so long traces stay navigable without losing the header.

The span tree

Span tree

Each node is a span. Indentation is causality — a child span happened inside its parent. Bar length is duration, so the critical path is visible at a glance.

The tree is virtualized: traces with hundreds of spans stay responsive.

Reading it:

  • A long parent with short children — time is being spent in the parent's own code, not in calls.
  • A long child — that call is your bottleneck.
  • Gaps between sibling spans — untraced work. Add a @trace there.
  • Repeated identical siblings — a retry loop or an agent that can't converge.

Span detail

Selecting a span shows everything captured for it:

Section Contents
Overview Name, kind, role, start time, duration, status
Prompt / Input Messages sent to the model, by role
Completion / Output What came back
Tokens Prompt, completion, total
Cost Computed for this span
Model parameters Temperature, max tokens, top-p, and other request settings
Attributes The full gen_ai.* and custom attribute set, as JSON
Exception Stack trace and message, when the span failed

Prompt and completion content is captured by default. If your prompts contain sensitive data, disable it with capture_message_content=False in trail.init(), or the standard OpenTelemetry env var OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=false. See Configuration.

Agent run traces

A trace rooted in an agent span renders with the agent workflow laid out: the run, its reasoning steps, the tools each step called, and the LLM calls inside them.

Agent run trace

The tools table on this view is capped in height so a tool-heavy run doesn't push the rest of the page off screen — scroll within it.

When the SDK sets a goal on the agent span, the panel also shows a "Goal:" line above the stat chips.

When the SDK/MCP integration also provides a goal-attainment verdict, the panel shows a "Goal met / Partially met / Goal missed" badge next to the goal, along with a percentage score and a one-sentence narrative explaining the judge's reasoning.

Run timeline

Below the tools table, "Run timeline" expands into an ordered, step-by-step replay of the run: one row per agent-scoped span (reasoning steps, task steps, tool calls), in the order they happened, each with a type icon (read / edit / run / search / tool / done), duration, and cost. Consecutive identical failing steps are flagged with a retry badge so a stuck retry loop is obvious at a glance.

A play/pause control with a 1×/2×/4× speed toggle scrubs a playhead across the run and highlights the step under it as it goes — useful for watching the shape of a long run without reading every row. You can also click directly on the scrubber rail to seek, or click any step to jump straight to it. The step list itself is height-capped the same way the tools table is, so a long run scrolls within the timeline instead of pushing the page down.

Clicking a step selects its span in the tree/waterfall view above (the same onSelectSpan behavior as the tools table) and expands that step's input/output inline, so you can go from "what happened" in the timeline straight to "what was said" without leaving the row.

If your browser/OS has "reduce motion" turned on, the play button is disabled (with a tooltip explaining why) instead of silently doing nothing — manual seeking on the rail still works either way.


Drilling down

Trace drill-down


Worked example — "one user says the bot gave a wrong answer"

  1. Time range — the window they reported.
  2. Application filter — the service they used.
  3. Search — a distinctive phrase from their question.
  4. Open the trace.
  5. Read the prompt on the LLM span. Most "the model was wrong" reports turn out to be "the model received the wrong context" — a RAG retrieval that returned nothing useful, or history that got truncated.
  6. If the context was right and the answer was still wrong, check model parameters — a temperature or model change is often the cause.

Sharing a trace

The detail URL contains the trace ID, so it's directly linkable:

https://your-trail-host/observations/tracing/<trace-id>

Anyone with access to that project can open it. Paste it into your issue tracker instead of screenshotting the tree.


Related