Skip to main content
Use getTraces when you want trace-centric pagination by project, optional inline spans, or filtering by session.

Relevant Source Files

  • src/traces/getTraces.ts for the exact query shape and server requirement

Example

import { getTraces } from "@arizeai/phoenix-client/traces";

const result = await getTraces({
  project: { projectName: "support-bot" },
  startTime: new Date("2026-03-01T00:00:00Z"),
  endTime: new Date("2026-03-02T00:00:00Z"),
  includeSpans: true,
  limit: 50,
});

for (const trace of result.traces) {
  console.log(trace.trace_id);
}

console.log(result.nextCursor);

Supported Filters

  • project
  • startTime
  • endTime
  • sort
  • order
  • limit
  • cursor
  • includeSpans
  • sessionId

Notes

  • getTraces requires a Phoenix server that supports project trace listing
  • Use the returned nextCursor to continue pagination
  • Set includeSpans when you need a trace-centric fetch that also contains span details
  • project accepts { project }, { projectId }, or { projectName }

Source Map

  • src/traces/getTraces.ts
  • src/types/projects.ts