instrument_openai_agents
junjo.plugins.openai_agents.instrument_openai_agents
Kind: Function
SDK version: 0.67.0
Documentation channel: Stable release
Signature
Section titled “Signature”instrument_openai_agents(*, tracer_provider: TracerProvider) -> OpenAIAgentsIntegrationTranslate first-party OpenAI Agents traces into OpenTelemetry spans.
The application owns the supplied provider, processors, exporters,
resource identity, and shutdown order. This function explicitly wraps the
active OpenAI Agents TraceProvider while preserving its configured
processors and native trace-export policy. Importing the module has no
instrumentation side effect.
Repeated calls with the same active OpenTelemetry provider share one registration and return independently closeable handles. A different provider cannot be selected until the active integration is closed.
Parameters
Section titled “Parameters”| Name | Type | Description | Default |
|---|---|---|---|
tracer_provider |
TracerProvider |
Process-lifetime OpenTelemetry SDK provider that owns the application’s existing trace pipeline. |
Returns
Section titled “Returns”OpenAIAgentsIntegration: Ownership handle that must be closed before the provider shuts down.
Raises
Section titled “Raises”| Exception | Description |
|---|---|
TypeError |
If tracer_provider is not an SDK provider. |
OpenAIAgentsIntegrationError |
If another provider is already active for the process-level OpenAI integration. |