Skip to content

Commit d49bd89

Browse files
committed
count both spans and traces
1 parent a41b320 commit d49bd89

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: src/agents/tracing/processors.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,17 @@ def export(self, items: list[Trace | Span[Any]]) -> None:
8181
traces: list[dict[str, Any]] = []
8282
spans: list[dict[str, Any]] = []
8383

84-
data = [item.export() for item in items if item.export()]
84+
# Categorize items into traces and spans
85+
for item in items:
86+
if hasattr(item, 'export') and callable(item.export):
87+
export_data = item.export()
88+
if export_data:
89+
if isinstance(item, Trace):
90+
traces.append(export_data)
91+
else:
92+
spans.append(export_data)
93+
94+
data = traces + spans
8595
payload = {"data": data}
8696

8797
headers = {

0 commit comments

Comments
 (0)