MCPcopy
hub / github.com/Agenta-AI/agenta / push

Function push

api/oss/src/utils/traces.py:76–84  ·  view source on GitHub ↗
(span)

Source from the content-addressed store, hash-verified

74 index = {}
75
76 def push(span) -> None:
77 if span.get("parent_span_id") is None:
78 tree[span["id"]] = OrderedDict()
79 index[span["id"]] = tree[span["id"]]
80 elif span.get("parent_span_id") in index:
81 index[span["parent_span_id"]][span["id"]] = OrderedDict()
82 index[span["id"]] = index[span["parent_span_id"]][span["id"]]
83 else:
84 log.error("The parent span id should have been in the tracing tree.")
85
86 for span in sorted(trace["spans"], key=lambda span: span["start_time"]):
87 push(span)

Callers 1

_make_spans_id_treeFunction · 0.70

Calls 2

getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected