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
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

