The traces module provides trace retrieval and trace-level annotation functions.Documentation Index
Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Relevant Source Files
src/traces/getTraces.tsfor the exact query shape and server requirementsrc/traces/addTraceAnnotation.tsfor single annotation writessrc/traces/logTraceAnnotations.tsfor batched annotation writessrc/traces/types.tsfor theTraceAnnotationtype
Retrieve Traces
UsegetTraces when you want trace-centric pagination by project, optional inline spans, or filtering by session.
Supported Filters
projectstartTimeendTimesortorderlimitcursorincludeSpanssessionId
Notes
getTracesrequires a Phoenix server that supports project trace listing- Use the returned
nextCursorto continue pagination - Set
includeSpanswhen you need a trace-centric fetch that also contains span details projectaccepts{ project },{ projectId }, or{ projectName }
Annotate a Single Trace
UseaddTraceAnnotation to attach a label, score, or explanation to one trace. If you supply an identifier, Phoenix upserts the annotation when an annotation with that identifier already exists.
sync: true to receive the annotation ID immediately; omit it (or pass false) for higher-throughput async writes.
TraceAnnotation Fields
| Field | Type | Required | Description |
|---|---|---|---|
traceId | string | Yes | OpenTelemetry Trace ID (hex, no 0x prefix) |
name | string | Yes | What is being measured (e.g. "groundedness"). The name "note" is reserved — use addTraceNote instead. |
annotatorKind | "HUMAN" | "LLM" | "CODE" | No | Defaults to "HUMAN" |
label | string | At least one of label/score/explanation | Categorical result (e.g. "correct") |
score | number | At least one of label/score/explanation | Numeric result (e.g. 0.95) |
explanation | string | At least one of label/score/explanation | Free-text justification |
identifier | string | No | Stable ID for idempotent upserts |
metadata | Record<string, unknown> | No | Arbitrary context |
Annotate Multiple Traces
UselogTraceAnnotations to batch-write annotations across many traces in a single request.
logTraceAnnotations sends all annotations in a single POST and returns an array of { id: string } objects (or an empty array when sync: false).
Source Map
src/traces/getTraces.tssrc/traces/addTraceAnnotation.tssrc/traces/logTraceAnnotations.tssrc/traces/types.tssrc/types/projects.ts

