Skip to content
Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion src/agents/tracing/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ def export(self, items: list[Trace | Span[Any]]) -> None:
traces: list[dict[str, Any]] = []
spans: list[dict[str, Any]] = []

data = [item.export() for item in items if item.export()]
# Categorize items into traces and spans
for item in items:
if hasattr(item, 'export') and callable(item.export):
export_data = item.export()
if export_data:
if isinstance(item, Trace):
traces.append(export_data)
else:
spans.append(export_data)

data = traces + spans
payload = {"data": data}

headers = {
Expand Down