Radicas Docs
Framework integrationsAgent frameworks

OpenAI Agents SDK

Connect OpenAI Agents SDK agents to Radicas via the OpenInference instrumentor.

Status: experimental — the strategy is implemented, but the deep-dive has NOT validated this path: no captured fixture and no registry card yet. This is the agent framework (openai-agents, Agent + Runner) — for the raw OpenAI client see OpenAI SDK.

Install

pip install "radicas[openai-agents]"   # = radicas + openinference-instrumentation-openai-agents

Use

import radicas

radicas.init(service="pricing-agent", feature="flight-pricing")
# instrument="auto" detects the `agents` module and activates
# OpenAIAgentsInstrumentor().instrument() — or: radicas.init(instrument=["openai-agents"])

from agents import Agent, Runner
agent = Agent(name="analyst", instructions=..., tools=[...])
result = Runner.run_sync(agent, prompt)
radicas.shutdown()

What it emits

  • Scope name: openinference.instrumentation.openai_agentsexpected, pending fixture.
  • Namespace: llm.* / openinference.* — mapped to gen_ai.* once the card exists.
  • Coverage: expected, pending fixture — the SDK models agent/generation/tool spans internally, so the tree should be rich; how it surfaces through OpenInference is unverified.

Shim behavior

  • Client-side adapter: intended, pending card — spans pass through unmapped until the registry card lands; then the same maps apply client-side and in the collector OTTL.
  • Server-side OTTL: pending the same card.

Known limitations

  • Not fixture-verified end-to-end.
  • An alternative route bridges the SDK's native tracing (TracingProcessor) to OTel — the deep-dive will decide; note the SDK's default trace export goes to OpenAI's backend (set_trace_processors() disables that) independently of what Radicas receives.
  • Detection keys on the top-level module name agents — generic, so in "auto" mode the strategy only actually activates when the OpenInference extra is installed.

Verify it works

SELECT model, input_tokens, output_tokens, estimated_cost_usd
  FROM otel.llm_call ORDER BY ts DESC LIMIT 5;
SELECT DISTINCT ScopeName, SpanName FROM otel_traces ORDER BY 1, 2;   -- deep-dive helper

Bench example (agent runnable, telemetry pending): agents/openai-agents/python in radicas-integrations.

On this page