Available in both SDKs. Python (
pip install 'sentrial[openai-agents]') and TypeScript (@sentrial/sdk with @openai/agents as an optional peer). Both register a trace processor with the Agents SDK’s tracing pipeline — registration is additive, so the default OpenAI-dashboard exporter keeps running alongside.What Gets Tracked Automatically
Sessions
One session per agent run (trace) — agent name from the root agent span, aggregated tokens and cost, final output.
LLM Calls
Every generation/response span as a per-call event — model, prompt/completion tokens, auto-calculated cost, duration.
Tool Calls
Each function span with the tool name, parsed arguments, result, and errors.
Handoffs
Agent-to-agent handoffs recorded as decisions (“Handoff from X to Y”).
Guardrails
A triggered guardrail is recorded as an error (and fails the session); a passed guardrail is recorded as a decision.
Errors
A failed run’s root agent span error becomes the session’s failure reason.
Installation
Quick Start
One function call. Then run your agents exactly like before.TypeScript:
@sentrial/sdk never imports @openai/agents itself — you hand it the SDK’s addTraceProcessor (or the whole module namespace: import * as agents from '@openai/agents'; instrumentOpenAIAgents(agents, options)). Python: instrument_openai_agents() is the only entry point that imports the openai-agents package.Configuration Options
How Runs Map to Sessions
Additional mapping notes:
- Session metadata carries
integration: "openai-agents"plus the OpenAItrace_id, so you can cross-reference the run in the OpenAI traces dashboard. - The session’s own input is not populated — the Agents SDK does not expose the run input on the trace object; the first user message rides in each generation span’s LLM event instead.
finish()recordsllm_calls,tool_calls, andhandoffsas custom metrics.- Speech, transcription, MCP-list, and custom spans are ignored — they carry no fields Sentrial models.
Don’t Combine with wrap_openai / wrapOpenAI
Batching, Explicit Clients & Short-Lived Processes
The Agents SDK invokes processor callbacks inline on the run’s path, so an explicit client with batching enabled is recommended — eachtrack call then enqueues and returns immediately instead of waiting on a network round-trip per span:
shutdown(), which finishes any still-open sessions as interrupted (failure reason “Trace not ended before processor shutdown”) and flushes the client’s event queue. In short-lived processes (scripts, serverless functions), don’t exit before queued events are sent — call force_flush() / forceFlush() on the processor (or flush() on the client) after your last run when batching is enabled.
Tracking is fail-safe by design: every processor callback is containment-wrapped, so a Sentrial error is logged and swallowed — it never crashes your agent run.
Next Steps
Python SDK Reference
Full SDK documentation with all methods and options.
TypeScript SDK Reference
Full SDK documentation with all methods and options.
Google ADK
The same Plugin-style integration for Google’s Agent Development Kit.

