Skip to main content
Access these through the tracing module:

init

Start exporting package-created agent spans to an Agent Lens project. project_name must be entity/project; this package deliberately does not depend on W&B account APIs to discover a default entity. Credentials come from api_key, WANDB_API_KEY, or the W&B host entry in .netrc. autopatch_integrations=True patches supported provider SDKs already in sys.modules and watches for providers imported later. Reinitialization flushes the previous session and reroutes new spans to the new project. Spans that are still open keep exporting to the project they started in; the previous session is closed by the next init or by shutdown.

force_flush

shutdown

TracingSession

Owns the OTLP provider and its background export worker. Fields

TracingSession.force_flush

TracingSession.shutdown

Last modified on September 30, 2026