count both spans and traces
This commit is contained in:
parent
a41b320580
commit
d49bd89061
1 changed files with 11 additions and 1 deletions
|
|
@ -81,7 +81,17 @@ class BackendSpanExporter(TracingExporter):
|
||||||
traces: list[dict[str, Any]] = []
|
traces: list[dict[str, Any]] = []
|
||||||
spans: 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}
|
payload = {"data": data}
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue