The Traces API allows you to send trace data to Phoenix and manage trace annotations. Traces are automatically ingested using OpenTelemetry Protocol (OTLP) or can be annotated for evaluation purposes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Arize-ai/phoenix/llms.txt
Use this file to discover all available pages before exploring further.
Endpoints
Send Traces
This endpoint is primarily used by OpenTelemetry SDKs and the Phoenix SDK. It accepts OTLP trace data in Protocol Buffer format.
Headers
Must be
application/x-protobufOptional compression:
gzip or deflateRequest Body
Binary Protocol Buffer data conforming to the OTLPExportTraceServiceRequest schema.
Response
200 on success
ExportTraceServiceResponse in Protocol Buffer format.
Example
Create Trace Annotations
Query Parameters
If
true, the request is processed synchronously and returns the created annotation IDs. If false, the request is queued for asynchronous processing.Request Body
Array of trace annotation objects
Response
Array of created annotation objects (only returned when
sync=true)Example
Delete Trace
Path Parameters
The trace identifier - either a Relay Global ID or an OpenTelemetry trace_id (hex string)
Response
Returns HTTP 204 (No Content) on success.Example
Using the Phoenix SDK
For easier trace management, use the Phoenix Python SDK:- Automatic OTLP trace serialization
- Connection management and retries
- Batch processing for efficiency
- Project name configuration
Error Handling
Trace not found (for DELETE operations)
Invalid request body or trace data
Server at capacity - the span processing queue is full. Retry with exponential backoff.
Best Practices
Use Async Mode
Use
sync=false (default) for trace annotations to avoid blocking on database writesBatch Annotations
Send multiple trace annotations in a single request to reduce HTTP overhead
Handle 503 Errors
Implement retry logic with exponential backoff when the server is at capacity
Use Compression
Enable gzip compression for large trace payloads to reduce bandwidth