Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions features/prompt-history/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ Once metadata is added, you will then be able to see it in the web UI.
![score](/images/metadata-ui.png)

Metadata is optimized for high-cardinality, request-specific values such as user IDs, session IDs, and error messages. For a smaller set of categories, such as environment, app, feature, or pipeline stage, use [tags](/features/prompt-history/tagging-requests) instead.

## Attaching metadata via OpenTelemetry

If you instrument your app with OpenTelemetry, you can attach metadata directly from span attributes — no `track.metadata()` call required. PromptLayer automatically maps standard attributes like `user.id` and `gen_ai.conversation.id`, and also reads arbitrary `promptlayer.metadata.<key>` attributes.

See [Attaching User Identity & Metadata](/features/opentelemetry#attaching-user-identity-metadata) in the OpenTelemetry guide for details.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the correct OTEL heading slug in cross-reference link

The new link likely points to a non-existent anchor: the target heading is Attaching User Identity & Metadata, and this docs repo already uses double-hyphen anchors when punctuation is stripped (for example, links like #google-gemini--native-image-generation in features/supported-providers.mdx). Using #attaching-user-identity-metadata can fail to jump to the intended section, so users land at the top of the OpenTelemetry page instead of the metadata instructions.

Useful? React with 👍 / 👎.

Loading