DOCS
OpenAI Agents SDK
The OpenAI Agents SDK keeps its own trace processors. To also send OpenTelemetry spans, install an OpenTelemetry bridge and point the HTTP exporter at Monitor. gRPC is not accepted.
- Create an ingest key. See keys.
- Install the Agents SDK, the HTTP OTLP exporter, and a bridge such as
openai-agents-opentelemetry. - Register the tracer provider before the agent runs.
- Add the bridge with
add_trace_processorso OpenAI's own exporter stays in place. Useset_trace_processorsonly when you want to replace that exporter. - Run one short agent call.
- Open Runs in the dashboard. The walkthrough also polls until the first trace arrives.
from agents import add_trace_processor
from openai_agents_opentelemetry import OpenTelemetryTracingProcessor
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
provider = TracerProvider()
provider.add_span_processor(
BatchSpanProcessor(
OTLPSpanExporter(
endpoint="https://balerxgate.com/v1/traces",
headers={"x-balerx-key": "YOUR_INGEST_KEY"},
),
max_export_batch_size=512,
)
)
trace.set_tracer_provider(provider)
add_trace_processor(OpenTelemetryTracingProcessor())The endpoint for this HTTP exporter includes /v1/traces. Give the span gen_ai.operation.name and gen_ai.agent.name if the bridge does not. Monitor uses those names to group the run.
Content in the OpenAI payload is a separate choice from Balerx content capture. Leave Balerx content capture off until you mean to store prompts.
