> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OTEL metadata mapping and attachment rendering with PydanticAI

export const plans_0 = "Any"

export const deployments_0 = "Any"

export const data_plane_version_0 = undefined

export const use_case_0 = "Use case - Using OTEL auto-instrumentation with PydanticAI when custom metadata fields don't appear searchable in the UI or attachments are missing from the Input panel"

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## Summary

**Issue:** PydanticAI's native OTEL instrumentation drops attachment content and only preserves file references, causing PDFs and other documents to disappear from Braintrust's Input panel. Custom metadata fields may also not appear searchable in the UI.

**Cause:** PydanticAI's `openinference-instrumentation-pydantic-ai` serializes `BinaryContent` as generic binary references without preserving the actual content for Braintrust's UI rendering. OTEL attributes only become searchable metadata when using the `braintrust.metadata.*` namespace.

**Resolution:** Replace PydanticAI's native instrumentation with the [Braintrust PydanticAI integration](https://www.braintrust.dev/docs/integrations/agent-frameworks/pydantic-ai) to preserve attachment content and ensure proper metadata mapping.

## Resolution steps

### If attachments are missing from the Input panel

#### Step 1: Stop using PydanticAI's native instrumentation

#### Step 2: Use the Braintrust PydanticAI integration

Follow the [Braintrust PydanticAI integration docs](https://www.braintrust.dev/docs/integrations/agent-frameworks/pydantic-ai) to preserve attachment content in the UI.
