Ingest OpenTelemetry traces using the standard OTLP/HTTP protocol.
This endpoint accepts an ExportTraceServiceRequest as defined by the OpenTelemetry specification. Spans carrying GenAI semantic convention attributes are automatically converted into PromptLayer request logs.
Supported content types:
application/x-protobuf — binary protobuf encoding (recommended)application/json — JSON encodingGzip Content-Encoding is supported for both formats.
Spans can include promptlayer.prompt.name (or promptlayer.prompt.id) and promptlayer.prompt.version (or promptlayer.prompt.label) attributes to link the generated request log to an existing prompt template in your workspace.
| Content-Type | Description |
|---|---|
application/x-protobuf | Binary protobuf encoding (recommended) |
application/json | JSON encoding |
Content-Encoding: gzip.
| Attribute | Maps to |
|---|---|
gen_ai.request.model | Model / engine |
gen_ai.provider.name | Provider type |
gen_ai.operation.name | Operation name (e.g. chat, text_completion, embeddings) |
gen_ai.usage.input_tokens | Input token count |
gen_ai.usage.output_tokens | Output token count |
gen_ai.input.messages | Request input messages |
gen_ai.output.messages | Response output messages |
gen_ai.request.temperature | Temperature parameter |
gen_ai.request.max_tokens | Max tokens parameter |
gen_ai.request.top_p | Top-p parameter |
gen_ai.response.finish_reasons | Finish reasons |
| Attribute | Type | Description |
|---|---|---|
promptlayer.prompt.name | string | Name of the prompt template to link |
promptlayer.prompt.id | integer | ID of the prompt template to link (alternative to name) |
promptlayer.prompt.version | integer | Specific version number (optional) |
promptlayer.prompt.label | string | Label to resolve to a version number (e.g. production). Used when version is not set. |
name or id must be provided to identify the prompt template. If the prompt is not found in the workspace, the span is still ingested but no request log link is created.
traceId must be exactly 32 hex characters (16 bytes)spanId must be exactly 16 hex characters (8 bytes)parentSpanId, if provided, must be exactly 16 hex characterspartialSuccess field of the response. Valid spans in the same request are still accepted.
API key to authorize the operation.
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 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.
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.