OTLP Endpoint
PromptLayer exposes an OTLP/HTTP endpoint at:Configure an SDK
Configure your OpenTelemetry SDK to export traces to PromptLayer using the OTLP/HTTP exporter.GenAI Semantic Conventions
Spans that use GenAI semantic conventions are automatically parsed into PromptLayer request logs. Add these attributes to your LLM call spans:Event-Based Conventions
PromptLayer also supports the newer event-based GenAI semantic conventions where message content is sent as span events rather than span attributes. This format is used by frameworks like LiveKit and newer versions of OpenTelemetry GenAI instrumentation. The following event types are recognized:
Event attributes like
gen_ai.system.message.content, gen_ai.user.message.content, and tool call data are automatically extracted and mapped to PromptLayer request logs.
When both attribute-based messages (
gen_ai.input.messages) and event-based messages are present on the same span, attribute-based messages take priority.Linking to Prompt Templates
You can associate OTEL spans with prompt templates in your PromptLayer workspace by setting custom span attributes:Attaching User Identity & Metadata
You can attach searchable metadata — including end-user identity and conversation IDs — to the request logs generated from your spans. This is the OpenTelemetry-native equivalent of the PromptLayer SDK’strack.metadata(), with no extra REST call required.
PromptLayer recognizes two kinds of span attributes for metadata.
Standard OpenTelemetry attributes
If your instrumentation already follows OpenTelemetry conventions, these are picked up automatically — no PromptLayer-specific attributes needed:PromptLayer custom metadata
For arbitrary key/value metadata, use thepromptlayer.metadata. namespace. Each attribute becomes a metadata key on the request log — for example, promptlayer.metadata.tenant becomes a tenant metadata key.
promptlayer.metadata.<key> always takes precedence over a standard attribute mapped to the same key. For example, if a span has both user.id and promptlayer.metadata.user_id, the promptlayer.metadata.user_id value wins.
Metadata is attached to the request log generated from the span, so set these attributes on your LLM call spans. To apply metadata across an entire trace, set the attributes as resource attributes — they apply to every span in the export.

