Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/agents/tracing/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,17 @@ def shutdown(self, timeout: float | None = None):
# No background thread: process any remaining items synchronously.
self._export_batches(force=True, deadline=deadline)

# Close the exporter so the underlying HTTP client and connection pool are released.
close_fn = getattr(self._exporter, "close", None)
if callable(close_fn):
try:
close_fn()
except Exception as exc:
logger.warning(
"[non-fatal] Tracing: exporter close failed: %s",
exc,
)

def force_flush(self):
"""
Forces an immediate flush of all queued spans.
Expand Down
Loading