Applies to:
- Plan -
- Deployment -
Summary
Issue: After upgrading the Braintrust SDK, a self-hosted deployment surfaces this error:- Python SDK: v4 (OTel-compatible) export by default as of v0.26.0.
- TypeScript SDK: v4 export by default as of braintrust@3.21.0.
BRAINTRUST_LEGACY_IDS=true until you can upgrade.
Background
By default, recent SDKs generate OpenTelemetry-compatible hex trace/span IDs (16-byte trace id / 8-byte span id) and export span components in the v4 format. SettingBRAINTRUST_LEGACY_IDS opts back into the legacy UUID-based IDs with v3 span-component export, which older data planes accept.
The version support is forward-compatible on the SDK side but not on the server side: a decoder can only read encodings up to the version it was built with. Keeping the SDK at or below the data plane’s supported version — or upgrading the data plane first — avoids the mismatch.
Resolution steps
Option 1: Upgrade Braintrust (recommended)
Upgrade your self-hosted data plane to a version that supports v4 span components. This is the durable fix and lets you keep the newer SDK and OpenTelemetry-compatible IDs. After upgrading, you can confirm the deployment version from the API URL configuration page:Option 2: Set BRAINTRUST_LEGACY_IDS=true in the SDK
If you cannot upgrade the deployment immediately, force the SDK back to legacy UUID IDs with v3 span-component export by setting the environment variable wherever your instrumented application runs:
BRAINTRUST_LEGACY_IDS=true in place is safe even after you later upgrade the data plane — newer data planes still decode v3 span components, so it keeps working. That said, once the data plane is upgraded it’s best to remove the flag so you switch back to OpenTelemetry-compatible hex IDs and v4 export.
BRAINTRUST_LEGACY_IDS is ignored when BRAINTRUST_OTEL_COMPAT is set, because OpenTelemetry compatibility mode requires hex IDs. If you rely on OTel compatibility, upgrade the data plane (Option 1) rather than pinning to legacy IDs.