Respan()
Respan()
Constructor
Parameters
Environment variables
Constructor parameters take precedence over environment variables.
Examples
With OpenAI Agents SDK
With OpenAI SDK
With multiple plugins
With default attributes
Attributes set on the constructor are attached to all spans for the lifetime of the instance:
For per-request attributes, use propagate_attributes() instead.
Minimal setup with env vars
No plugins (decorators only)
flush()
Force flush all pending spans to exporters. Short-lived Python scripts drain pending spans automatically on normal process exit; call flush() only when you need an explicit export checkpoint before the process continues, or in serverless environments that may freeze before process-exit hooks run.
shutdown()
Deactivate all plugins and shut down the OTEL pipeline.