Arize Phoenix TS
    Preparing search index...
    • Experimental

      Log spans to a project using Phoenix's simplified span structure.

      If any span in the request is invalid or a duplicate of a span that already exists, none of the spans in the request are queued and a SpanCreationError is thrown with details about the failures.

      this function is experimental and may change in the future

      Parameters

      Returns Promise<LogSpansResult>

      Statistics about the operation. When successful, totalQueued equals totalReceived.

      const result = await logSpans({
      project: { projectName: "my-project" },
      spans: [
      {
      name: "test",
      context: { trace_id: "123", span_id: "456" },
      span_kind: "CHAIN",
      start_time: "2024-01-01T00:00:00Z",
      end_time: "2024-01-01T00:00:01Z",
      status_code: "OK",
      },
      ],
      });
      console.log(`Queued ${result.totalQueued} spans`);