Skip to main content
A span eval scores one span. A trace eval scores every span in one request; a session eval scores every trace sharing a session.id. Each returns one label, score, and explanation for the unit it scores - one trace for a trace eval, one session for a session eval. For which scope answers which question, see Eval scope; for the conceptual distinction, see Evaluation levels.

How trace and session evals work

The Scope dropdown on the evaluator form sets whether an evaluator scores a span, a trace, or a session. You run it by attaching it to a task, which points it at a data source and sets what to score and how often. All evaluators on one task share a scope, so cover several scopes on one project with a task for each.
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 that share a name stay distinct: 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 share one form with two halves. The left pane defines the evaluator: name, scope, judge model, template, and choices. The numbered Configuration column on the right points it at data and sets up the task. The steps below follow that order, with one extra decision for sessions 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 the agent took.
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

Point it at data and configure the task

Choose Project in the Configuration column - a dataset is scored one example at a time whatever the scope, so trace grouping applies only to a project. Filtering here accepts a multi-span query, available only at trace and session scope. Then map each variable and set sampling and cadence, as in Run online evals on traces.
6

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. Use the data preview under Map Variable to Data to confirm what the judge receives before you run the task.

View results

Trace results appear in the Trace Evals row of the trace header, and session results in the Session Evals row of the session header. In the traces table, add the Trace Evaluations or Session Evaluations column and filter on trace_eval.<name>.label or session_eval.<name>.score to isolate failures. See Results and costs for reading results in general.
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.
Log each dataframe with client.spans.update_evaluations(). 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.

Session-level evals

Scoring a full multi-turn conversation end to end.

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.