Skip to main content
A span eval scores one span. A trace eval scores every span in a single request, and a session eval scores every trace that shares a session.id. Each returns one result for the thing it scores, so a trace eval returns one label, score, and explanation for the whole request, and a session eval returns one label, score, and explanation for the whole conversation. This guide covers how Arize AX assembles the data a trace or session evaluator sees, and how to configure a trace eval and a session eval. For the conceptual distinction between span, trace, and session, see Evaluation levels.

When to use each scope

Pick the narrowest scope that can answer your question. A session eval passes far more context to the judge than a span eval does, and that extra context raises cost and gives the judge more text to weigh. Throughout this page, unit means whatever one evaluator run scores: a single trace for a trace eval, and a single session for a session eval.

How trace and session evals work

Every evaluator has a scope, set with the Scope dropdown on the evaluator form, and that scope determines whether the evaluator scores a span, a trace, or a session. You run an evaluator by attaching it to a task, which connects it to a data source and defines what to score and how often. Every evaluator on one task must share the same scope, so a task is span-level, trace-level, or session-level, not a mix. To run evaluators at different scopes against the same project, create a separate task for each scope.
New Evaluator form for a hallucination evaluator with the Scope dropdown open and highlighted, listing Span for evals on an individual span, Trace for evals across an entire trace, and Session for evals across traces in a session, with Session selected, and a Configuration column on the right showing Pick a Data Source, Filter Sessions, Preview Matching Data, and Map Variable to Data

Set Scope to Trace or Session on the New Evaluator form

Session-only variables

Session evaluators have two variables that Arize AX assembles for you rather than reading from a span attribute, one entry per turn, where a turn is one trace in the session. The two are mutually exclusive, and you choose between them with the Conversation and Turn data radio buttons on the evaluator form.
  • {conversation} is the session transcript Arize AX builds as a JSON array with one input / output pair per turn, taken from each trace’s root span in chronological order. It needs no variable mapping, and it is valid only at session scope.
  • {turn_data} is the string Arize AX produces by rendering a Turn Definition template you write once per turn, then joining the rendered turns with TURN 1, TURN 2, and so on as separators. Use it when the default input/output transcript leaves out something the judge needs, such as tool results or retrieved context.
New Evaluator form with Scope set to Session and the Conversation and Turn data radio buttons highlighted, Conversation selected and captioned evaluate the full session transcript with input and output per turn, Turn data captioned evaluate a custom per-turn layout you define below, and the Configuration column on the right showing Task Configuration with a name, sampling rate, Run Continuously and One-Time Backfill toggles, and an Advanced section

Choosing Conversation or Turn data on the New Evaluator form

How variables are filled in

At span scope, each template variable reads one value from one span. At trace and session scope, a variable can match many spans, so the matching values are concatenated with commas in chronological order. For trace evals, spans are ordered by span timestamp. For session evals, spans are grouped into traces first, and traces are ordered by earliest span timestamp. Each value is truncated at 100,000 characters, and after that truncation a session’s fully assembled value is capped at 100,000 characters. Some judge models raise both limits.

Where results land

Each unit produces one result, written to that unit’s root span. Results are stored under a prefixed column name so span, trace, and session evals with the same name never collide: Sampling on a trace or session task applies per unit, so 10% sampling on a session task evaluates 10% of sessions rather than 10% of spans.
When a task runs, Arize AX collects each unit’s spans from a window that extends 24 hours before the time window the task itself evaluates, so a session that has been idle for longer than that contributes only its recent traces. Arize AX searches back 7 days to find a unit’s root span, so results still land on the correct span for long-running sessions.

Set up a trace or session eval

Trace and session evaluators are built on the same form, which has two halves. The left pane defines the evaluator itself: its name, scope, judge model, template, and choices. The numbered Configuration column on the right points that evaluator at data and sets up the task that runs it. The steps below follow the form in order. Session evaluators add one further decision about how each turn reaches the judge.
1

Open the New Evaluator form

Open Evaluators in the left navigation and click New Evaluator, or open a trace from the traces table and click Add Trace Eval in the trace header, an action that pre-sets the scope for you.
2

Name it and set Scope to Trace

In the left pane, enter a Name and set Scope to Trace. The Result Column Name is auto-populated from the name and becomes the trace_eval.<name> column.
3

Pick the judge model and write the template

Choose the judge model above the template, then write the template, referencing the variables the judge needs, for example {question}, {tool_calls}, and {output}. Because the eval sees the whole trace, write criteria about the path taken, not about a single response.
4

Define Choices and Optimization Direction

Below the template, define Choices and their scores, then set the Optimization Direction so Arize AX knows whether a higher or a lower score is better.
5

Pick a Data Source

In the Configuration column, choose Project and select the project whose traces you want scored. The picker also offers Dataset, but a dataset is scored one example at a time whatever the scope, so trace grouping applies only to a project.
6

Filter Traces

Narrow the traces the evaluator runs on. This step accepts a multi-span query, which combines several named span filters with operators such as AND and “followed by” to describe a pattern of spans within one trace. Multi-span queries are available only at trace and session scope.
7

Preview Matching Data

Read the sample the filter returns to confirm it admits the traces you expect before you map any variables.
8

Map Variable to Data

Point each template variable at a column. Arize AX joins the values from every matching span with commas, in chronological order, and Data preview under each mapping shows the value it pulled from the latest matching trace.
9

Set Task Configuration

Name the task, set the Sampling Rate (%), and turn on either Run Continuously to score new traces as they arrive or One-Time Backfill to score history once. Advanced holds an optional LLM Override and the Enable tracing toggle. See Run online evals on traces for how to pick a sampling rate.
10

Create the evaluator

Click Create Evaluator to save it to the Evaluator Hub for reuse, or Create and Run Evaluator to save it and start the task you just configured.
Use Evaluator(s) Task Configuration form for a hallucination evaluator scoped to Trace, showing the gpt-4o judge model and a template referencing input, context, and output variables on the left, and on the right Preview Matching Data listing chain, LLM, embedding, and retriever spans of matching traces, then Map Variable to Data mapping input to the input column with a data preview of the latest matching trace

A trace-scoped evaluator, its matching traces, and its variable mapping

The steps above describe the New Evaluator form. Attaching an evaluator that already exists in the Evaluator Hub opens the same Configuration column under the title Use Evaluator(s) – Task Configuration, where the primary button reads Run Evaluator(s) and the Configuration steps are numbered from the point you enter.Test Evaluator On Spans is disabled for trace- and session-scoped evaluators when the data source is a project, so use the data preview under Map Variable to Data to confirm what the judge receives before you run the task.

View results

Trace and session results appear alongside your traces once the task runs.
  • Trace detail: open a trace from the traces table and read the Trace Evals row in the header. Each result appears as a colored label, and hovering over one shows its score and explanation.
  • Session detail: open a session from the Sessions tab and read the Session Evals row in the header, where the labels behave the same way.
  • Traces table: add the Trace Evaluations or Session Evaluations column from the column picker to scan results across many units, and filter on trace_eval.<name>.label or session_eval.<name>.score to isolate failures.
Session detail view showing total duration, total tokens, and total traces alongside a Session Evals row with a hallucination label and a Session Coherence incoherent label, the latter expanded into a panel giving the label incoherent, a score of 0, and an explanation of why the conversation was repetitive and unfocused

Session Evals in the session header, with one result expanded

Log trace and session evals from code

If you run evals in your own environment, log results back with the prefix that matches the scope. Every result needs a context.span_id column, and for trace and session evals that column holds the id of the unit’s root span, which is the trace’s root span for a trace eval and the root span of the session’s first trace for a session eval.
For the full export, evaluate, and log flow, including how far back evals can be applied, see Run online evals on traces.

Further reading

Run online evals on traces

Task filters, sampling rates, cadence, and run logs in full.

Agent trajectory evaluations

The canonical trace eval: judging the path an agent took.

Trace evals for a recommendation agent

A worked trace-scoped example, end to end.

Session evals for an AI tutor

A worked session-scoped example across a multi-turn conversation.