NexusOpenAITracingProcessor to capture every span emitted by the OpenAI Agents SDK and send it to Nexus automatically.
Install
Set up the processor
Runner.run calls in the process are captured automatically.
Environment variables
Full example
Dev vs production
- Development — set
NEXUS_DEV_MODE=truein your.envfile. The processor records traces locally without firing the external trigger endpoint. - Production — set
NEXUS_DEV_MODE=false(or leave it unset). The processor firesPOST {trigger_url}/catch_route_manualwithuser_idandtrace_idafter each root span completes.
Best practices
- Store
NEXUS_API_KEYin environment variables — never hardcode it. - Reuse one
NexusClientfor the lifetime of the process. - Call
set_trace_processorsonce at startup, before anyRunner.runcalls.
nexus_api_key from the Nexus platform: Nexus platform.