-
Notifications
You must be signed in to change notification settings - Fork 172
feat: OpenAI agents sdk instrumentation #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| this._enabled = true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State flag prevents second instrumentation method call
The createProcessor() method sets _enabled = true, which causes instrument() to return early. This prevents using createProcessor() followed by manual registration, defeating the purpose of having two separate APIs. The _enabled flag should only be set when actually registering with the SDK via instrument(), not when merely creating a processor instance.
Additional Locations (1)
@arizeai/openinference-core
@arizeai/openinference-genai
@arizeai/openinference-instrumentation-anthropic
@arizeai/openinference-instrumentation-bedrock
@arizeai/openinference-instrumentation-bedrock-agent-runtime
@arizeai/openinference-instrumentation-beeai
@arizeai/openinference-instrumentation-langchain
@arizeai/openinference-instrumentation-langchain-v0
@arizeai/openinference-instrumentation-mcp
@arizeai/openinference-instrumentation-openai
@arizeai/openinference-instrumentation-openai-agents
@arizeai/openinference-mastra
@arizeai/openinference-semantic-conventions
@arizeai/openinference-vercel
commit: |
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off-by-one in handoff tracking memory cap
The reverseHandoffsDict size limit check occurs after adding a new entry and only removes one entry when the limit is exceeded. This allows the map to grow to MAX_HANDOFFS_IN_FLIGHT + 1 before cleanup, and when handoffs arrive faster than agent spans consume them, the cleanup rate becomes insufficient. The condition should check the size before adding or remove enough entries to stay under the limit.
Note
Introduces OpenInference instrumentation for the OpenAI Agents SDK with a processor that maps SDK traces/spans to OpenTelemetry using OpenInference semantics.
@arizeai/openinference-instrumentation-openai-agentspackage exportingOpenAIAgentsInstrumentationandOpenInferenceTracingProcessorto register viasdk.addTraceProcessor()and emitAGENT/LLM/TOOLspans with attributes (messages, tools, usage, handoffs)basic-usage,guardrails,handoffs,lifecycle-hooks,multi-turn,streaming,structured-output) and sharedinstrumentation.tssetupgraph.node.id/parent_id), errors, and instrumentation wiringpackage.json,tsconfig*.json,vitest.config.ts) and updates lockfilesWritten by Cursor Bugbot for commit af3d98d. This will update automatically on new commits. Configure here.