Skip to content

OpenAI Agents SDK: BraintrustTracingProcessor not registered in auto_instrument() #152

@braintrust-bot

Description

@braintrust-bot

Gap

BraintrustTracingProcessor — the fully implemented tracing integration for the OpenAI Agents SDK — is not registered by auto_instrument(). Every other supported integration (OpenAI, Anthropic, LiteLLM, Pydantic AI, Google GenAI, Agno, Claude Agent SDK, DSPy, ADK) is wired into auto_instrument(), but users of the OpenAI Agents SDK must manually call set_trace_processors():

from agents import set_trace_processors
from braintrust.wrappers.openai import BraintrustTracingProcessor
set_trace_processors([BraintrustTracingProcessor()])

This is inconsistent with the documented one-line auto-instrumentation pattern and means users who rely on braintrust.auto_instrument() silently get zero tracing for agent runs.

What is missing

auto_instrument() should include an openai_agents: bool = True parameter (or fold it into the existing openai flag) that calls set_trace_processors([BraintrustTracingProcessor()]) when the openai-agents package is installed.

The processor implementation is complete — it handles all 11 span data types, token usage, TTFT metrics, and nested span contexts. Only the auto-registration wiring is missing.

Braintrust docs status

supported — the OpenAI Agents SDK integration page documents the integration and shows auto_instrument() as the recommended setup path, but the Python SDK does not actually register the processor via that path.

Upstream sources

Local files inspected

  • py/src/braintrust/auto.pyauto_instrument() (lines 29–126) has no reference to openai-agents, TracingProcessor, set_trace_processors, or BraintrustTracingProcessor
  • py/src/braintrust/wrappers/openai.pyBraintrustTracingProcessor is fully implemented, handles all span types
  • py/src/braintrust/wrappers/test_openai.py — 4 test functions exist (one skipped), all manually register the processor
  • py/setup.py line 33 — openai-agents is declared as an optional dependency under extras_require["openai-agents"]

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions