Ingest Traces (OTLP)
Behavior Notes
- This endpoint accepts an
ExportTraceServiceRequestas defined by the OpenTelemetry specification. - Spans carrying GenAI semantic convention attributes are automatically converted into PromptLayer request logs.
- Supported content types are
application/x-protobuffor binary protobuf encoding andapplication/jsonfor JSON encoding. - Gzip
Content-Encodingis supported for both formats. - Spans can include
promptlayer.prompt.name, optionally withpromptlayer.prompt.version, to link the generated request log to an existing prompt template in your workspace. - Spans can include
user.id/enduser.id,gen_ai.conversation.id/session.id, andpromptlayer.metadata.*attributes to attach searchable user identity and metadata to the generated request log. - For SDK setup, GenAI semantic conventions, prompt template linking, metadata, and collector configuration, see OpenTelemetry.
Related
Authorizations
Headers
The encoding of the request body. Use application/x-protobuf for binary protobuf or application/json for JSON.
application/x-protobuf, application/json Set to gzip if the request body is gzip-compressed.
gzip Query Parameters
When true, all trace IDs in the request are marked as closed after ingestion. Subsequent span writes for those traces will be rejected with HTTP 409. Defaults to false.
Body
An OTLP ExportTraceServiceRequest in JSON encoding. See the OTLP specification for the full schema.
An array of ResourceSpans. Each element describes spans from a single instrumented resource.
Response
Successful Response. When using protobuf, the response is a binary ExportTraceServiceResponse. When using JSON, the response is a JSON object.
Response to an OTLP trace export request.
Present only when some spans were rejected. Null when all spans were accepted.

