Interface TraceExporter

All Known Implementing Classes:
OpenAITraceExporter

public interface TraceExporter
TraceExporter

Interface for exporting trace and span data to external systems. Implementations send traces to OpenAI platform, logging systems, or other backends.

The exporter receives batches of items (Trace and Span objects) and is responsible for: - Serializing items to the target format - Sending data via HTTP, gRPC, or other protocols - Handling errors and retries

Source: https://github.com/openai/openai-agents-js/blob/main/packages/agents-core/src/tracing/exporter.ts

  • Method Details

    • export

      CompletableFuture<Void> export(List<Object> items)
      Export a batch of trace items (Trace and Span objects).

      The implementation should: 1. Serialize items to target format 2. Send to external system 3. Handle errors appropriately (log or retry)

      Parameters:
      items - List of Trace and Span objects to export
      Returns:
      CompletableFuture that completes when export finishes (or fails)
    • shutdown

      default CompletableFuture<Void> shutdown(long timeoutMs)
      Shutdown the exporter gracefully. Should flush any pending data and release resources.
      Parameters:
      timeoutMs - Maximum time to wait for shutdown
      Returns:
      CompletableFuture that completes when shutdown finishes