Arize Phoenix TS
    Preparing search index...
    • Get traces from a project with filtering and sorting options.

      This method fetches traces from a project with support for time range filtering, sorting, session filtering, and cursor-based pagination.

      Parameters

      Returns Promise<GetTracesResult>

      A paginated response containing traces and optional next cursor

      Phoenix server >= 13.15.0

      // Get recent traces from a project
      const result = await getTraces({
      client,
      project: { projectName: "my-project" },
      limit: 50,
      });

      // Get traces in a time range with spans included
      const result = await getTraces({
      client,
      project: { projectName: "my-project" },
      startTime: new Date("2024-01-01"),
      endTime: new Date("2024-01-02"),
      includeSpans: true,
      });

      // Paginate through results
      let cursor: string | undefined;
      do {
      const result = await getTraces({
      client,
      project: { projectName: "my-project" },
      cursor,
      limit: 100,
      });
      result.traces.forEach(trace => {
      console.log(`Trace: ${trace.trace_id}`);
      });
      cursor = result.nextCursor || undefined;
      } while (cursor);