@@ -35,6 +35,7 @@ def auto_instrument(
3535 google_genai : bool = True ,
3636 agno : bool = True ,
3737 claude_agent_sdk : bool = True ,
38+ openai_agent_sdk : bool = True ,
3839 dspy : bool = True ,
3940 adk : bool = True ,
4041) -> dict [str , bool ]:
@@ -55,6 +56,7 @@ def auto_instrument(
5556 google_genai: Enable Google GenAI instrumentation (default: True)
5657 agno: Enable Agno instrumentation (default: True)
5758 claude_agent_sdk: Enable Claude Agent SDK instrumentation (default: True)
59+ openai_agent_sdk: Enable OpenAI Agent SDK instrumentation (default: True)
5860 dspy: Enable DSPy instrumentation (default: True)
5961 adk: Enable Google ADK instrumentation (default: True)
6062
@@ -118,6 +120,8 @@ def auto_instrument(
118120 results ["agno" ] = _instrument_integration (AgnoIntegration )
119121 if claude_agent_sdk :
120122 results ["claude_agent_sdk" ] = _instrument_integration (ClaudeAgentSDKIntegration )
123+ if openai_agent_sdk :
124+ results ["openai_agent_sdk" ] = _instrument_openai_agent_sdk ()
121125 if dspy :
122126 results ["dspy" ] = _instrument_dspy ()
123127 if adk :
@@ -134,6 +138,16 @@ def _instrument_openai() -> bool:
134138 return False
135139
136140
141+ def _instrument_openai_agent_sdk () -> bool :
142+ with _try_patch ():
143+ from agents import set_trace_processors
144+ from braintrust .wrappers .openai import BraintrustTracingProcessor
145+
146+ set_trace_processors ([BraintrustTracingProcessor ()])
147+ return True
148+ return False
149+
150+
137151def _instrument_integration (integration ) -> bool :
138152 with _try_patch ():
139153 return integration .setup ()
0 commit comments