Skip to main content

How to View a Trace in the MLflow UI

· 6 min read
Jagdish Kumawat
Founder @ Dewiride

Once your app sends traces to MLflow, the Traces page is where you read them: a table of every call, and a detailed view of each one with its inputs, outputs, tokens and cost. This guide walks through both with two traced Claude calls, with real screens from MLflow 3.18.0.

How the Trace View Is Organized​

AreaWhat it shows
Traces page (experiment sidebar)A table with one row per trace: time, input, output, duration, state and tokens
Trace view, top barThe trace's ID, state, duration, tokens and estimated cost, with buttons to step to the previous or next trace
Spans panel (left)The steps the trace recorded, as a tree
Inputs / Outputs tab (right)What the selected span received and returned, shown as Pretty, YAML or JSON

MLflow's documentation: "After logging your traces, you can view them in the MLflow UI, under the 'Traces' page in your experiment. The page is for browsing the list of traces with rich search and filtering capabilities, as well as inspecting the details of each trace."

Prerequisites​

  • Traces in a tracking server. This guide uses an experiment called trip-questions with two traced calls to Claude, on a server at http://127.0.0.1:8080.

The Example Traces​

This script traced two calls with mlflow.anthropic.autolog(), one question each:

trip_questions.py
import anthropic
import mlflow

mlflow.set_tracking_uri("http://127.0.0.1:8080")
mlflow.set_experiment("trip-questions")
mlflow.anthropic.autolog()

client = anthropic.Anthropic()

for question in [
"Name one thing to check before a long bike ride, in one sentence.",
"Name one snack that travels well on a hike, in one sentence.",
]:
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1024,
messages=[{"role": "user", "content": question}],
)
print(message.content[-1].text)

The trip_questions.py script in a macOS-style code window: MLflow tracing is set up for the trip-questions experiment and two questions are sent to claude-opus-5-5 in a loop, printing each answer.

Terminal
uv run --env-file .env trip_questions.py
Output
2026/11/30 17:31:18 INFO mlflow.tracking.fluent: Experiment with name 'trip-questions' does not exist. Creating a new experiment.
Check your tire pressure to make sure the tires are properly inflated and free of damage.
Trail mix is a great hiking snack because it's lightweight, doesn't need refrigeration, and packs a mix of energy-boosting nuts, seeds, and dried fruit.
2026/11/30 17:31:21 INFO mlflow.tracing.export.async_export_queue: Flushing the async trace logging queue before program exit. This may take a while...

The output in a terminal: MLflow creates the trip-questions experiment, then the two answers print, one about tire pressure and one about trail mix.

Step 1: Open the Traces Page​

Open http://127.0.0.1:8080, click the experiment, here trip-questions, then Traces in the left sidebar:

The Traces page of trip-questions: two rows, newest first, with the snack and bike questions as inputs, the start of each reply as output, durations of 1.5 and 1.4 seconds, state OK and 90 and 64 tokens.

Each row is one trace, newest first. Input is the question, Output the start of the reply, and Tokens what the call used. The toolbar above filters the list; Last 7 days limits it to recent traces.

Step 2: Open a Trace​

Click a trace's input, here the snack question:

The trace view: the top bar shows trace 08c3744d, Success, 1.48 seconds, 90 tokens and about $0.0014; the Spans panel lists Messages.create; the right side shows the user question, max_tokens, model and the assistant's answer about trail mix.

The top bar summarizes the whole trace. The Spans panel lists its steps: here one, Messages.create, the Claude call. On the right, Inputs shows what was sent, the question as a chat bubble followed by the other settings, and Outputs shows Claude's answer.

Step 3: Switch Between Pretty, YAML and JSON​

Click Pretty next to Inputs to choose how the data is shown:

The view menu open next to Inputs, with Pretty checked and YAML and JSON as the other choices.

Choose JSON to see the exact request:

The Inputs section in JSON view: numbered lines starting with max_tokens 1024 and the messages list, collapsed after four lines with a See more link, and the Outputs section still in Pretty view.

Pretty is easiest to read, JSON is exactly what your code sent, which helps when you compare it with the SDK call, and See more expands long data. Inputs and Outputs each have their own setting.

Step 4: Step to the Next Trace​

Click the › arrow at the top left, Next trace:

The trace view now showing trace cc682720: 1.38 seconds, 64 tokens, about $0.0008, with the bike question as the input.

The view moved to the next row of the table, the bike question, without closing. ‹ goes back, and the × at the top right, or Esc, closes the view.

Common Mistakes​

MistakeWhat happensDo this instead
Reading the Output column as the answerIt's the start of the response object's JSONOpen the trace; Outputs shows the answer as text
Expecting old traces in the listThe default time range is Last 7 daysWiden the time range in the toolbar

Troubleshooting​

SymptomLikely causeFix
The page shows data from another serverThe browser tab kept the previous server's pageReload the page
A trace you just made is missingThe program is still sending it, or the page hasn't refreshedWait a moment and click the refresh button in the toolbar

FAQ​

Why is the Output column JSON?​

For an Anthropic call, the trace's output is the whole response object, and the table shows the start of it. The trace view shows the answer as text.

Can I copy an input or output?​

Yes. Each field has a copy button on its right.

Conclusion​

The Traces page listed both calls with their tokens and timing, the trace view showed the snack question's inputs and answer in Pretty and JSON form, and Next trace moved to the bike question without leaving the view.

Additional Resources​