OpenAI Agents SDK
Capture traces from the OpenAI Agents SDK over OTLP
Choose a setup method
| Method | Use it when |
|---|---|
| Voxmith skill | You want your coding agent to inspect the app, make the change, and verify it. |
| Voxmith SDK | You want explicit control over the interaction boundaries and fields. |
| OpenTelemetry | The framework already emits useful spans or you operate an OTel pipeline. |
Start with one method for a call path. Combining SDK tracking with framework OpenTelemetry on the same call can create duplicate interactions.
Recommended: Voxmith skill
Recommended. Choose this path when you want your coding agent to inspect the project, select a supported transport, make the smallest instrumentation change, send a test event, and verify that it reached Voxmith.
Install the skill once in your coding-agent environment:
npx skills add Voxmith/skills --skill voxmithRun the framework-specific prompt below from the application root. Review the resulting diff before deploying it.
Use the voxmith skill to add Voxmith analytics to this OpenAI Agents application.
Org ID: your-org-id
Instrument the real Runner call and verify one fresh interaction.Manual setup: Voxmith SDK
pip install voxmithimport voxmith
from agents import Runner
voxmith.init("your-org-id")
interaction = voxmith.begin(user_id="u-42", agent_name="openai-agent", input=prompt)
try:
result = Runner.run_sync(agent, prompt)
interaction.end(output=str(result.final_output))
except Exception as exc:
interaction.end(output=str(exc), success=False)
raise
finally:
voxmith.shutdown()Manual setup: OpenTelemetry
Install
pip install openai-agents openinference-instrumentation-openai-agents \
opentelemetry-sdk opentelemetry-exporter-otlp-proto-httpSetup
import os
from agents import set_tracing_disabled
from openinference.instrumentation.openai_agents import OpenAIAgentsInstrumentor
from openinference.instrumentation import using_attributes
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
os.environ["OTEL_EXPORTER_OTLP_ENDPOINT"] = "https://otel.voxmith.com"
os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = "X-Voxmith-Org-ID=<your-org-id>"
set_tracing_disabled(True) # turn off OpenAI's hosted trace backend
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
OpenAIAgentsInstrumentor().instrument(tracer_provider=provider)
with using_attributes(session_id="sess-123", user_id="u-42"):
await Runner.run(agent, "Hello")You get agent / handoff / guardrail spans plus the underlying LLM call spans with full message and tool data (llm.input_messages.*, llm.output_messages.*, tool.name, tool.parameters, llm.token_count.*).
Caveats
Without set_tracing_disabled(True), traces also flow to OpenAI's hosted dashboard.
Verify
Run one Runner.run call, then open Events in Voxmith. Confirm agent, handoff, guardrail, and LLM spans are present.
Troubleshooting
- Call
set_tracing_disabled(True)if you do not want dual-send to OpenAI's hosted trace backend. - Confirm
OTEL_EXPORTER_OTLP_HEADERScontainsX-Voxmith-Org-ID=<your-org-id>. - Confirm
using_attributeswraps the call you want grouped.
References
Next steps
- Conversations: review the complete agent run.
- Events: inspect model calls, handoffs, guardrails, and tools.
- Intents: organize production conversations by what users wanted.