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/transferTraces.tsfor moving traces between projectssrc/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 }
Move Traces To Another Project
UsetransferTraces to move one or more traces from their current project to a destination project. This operation moves rather than copies the traces: after a successful transfer, they no longer appear in the source project.
All traces in one call must currently belong to the same source project. Each trace identifier can be either an OpenTelemetry trace ID or a Phoenix trace GlobalID, and the destination can be either a project name or project GlobalID.
transferTraces requires Phoenix server 20.4.0 or newer.
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
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/transferTraces.tssrc/traces/types.tssrc/types/projects.ts

