Skip to content

Add instrumentation for @openai/agents #16963

Description

@matejminar

Activity

  1. mydea commented on Sep 18, 2026

    @mydea
    Member

    Scope + relevance (adding detail to this request)

    Relevance (npm)

    • @openai/agents: ~6.3M downloads/month (~33.3M last year) — running at more than 2x the trailing-12-month average, i.e. steep growth. First-party OpenAI agent framework, and unlike most OpenAI-compatible providers it is not covered by any of our existing proxies (Vercel AI SDK / OpenAI client / LangChain) — it's its own orchestration runtime, so agent runs, handoffs, and tool calls are currently invisible.

    Rough scope

    • Add instrumentation logic under packages/server-utils/src/ai/openai-agents/ and wire it up via src/integrations/openai-agents.ts, registered in getTracingIntegrations(); runtime packages re-export from @sentry/server-utils.
    • The SDK (openai-agents-js) exposes a tracing/hooks system — prefer hooking that over monkey-patching. Map its concepts to gen_ai.* spans per the span attribute conventions: agent invocation (invoke_agent), model/LLM generations (chat), tool executions (execute_tool), and handoffs, with the run as the parent span.
    • The underlying model calls go through the OpenAI client we already instrument — make sure the agent spans nest correctly with (and don't double-count) those, similar to how we handle LangChain/LangGraph over the provider SDKs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions