MCPcopy
hub / github.com/microsoft/agent-lightning / _build_span

Function _build_span

tests/algorithm/test_baseline.py:48–69  ·  view source on GitHub ↗
(rollout_id: str, attempt_id: str, *, sequence_id: int, index: int)

Source from the content-addressed store, hash-verified

46
47
48def _build_span(rollout_id: str, attempt_id: str, *, sequence_id: int, index: int) -> Span:
49 trace_hex = f"{index:032x}"
50 span_hex = f"{index:016x}"
51 # Minimal span that passes validation and keeps log output predictable.
52 return Span(
53 rollout_id=rollout_id,
54 attempt_id=attempt_id,
55 sequence_id=sequence_id,
56 trace_id=trace_hex,
57 span_id=span_hex,
58 parent_id=None,
59 name="test-span",
60 status=TraceStatus(status_code="OK"),
61 attributes={"stage": "collect"},
62 events=[],
63 links=[],
64 start_time=None,
65 end_time=None,
66 context=SpanContext(trace_id=trace_hex, span_id=span_hex, is_remote=False, trace_state={}),
67 parent=None,
68 resource=OtelResource(attributes={}, schema_url=""),
69 )
70
71
72async def _mock_runner(

Callers 2

_mock_runnerFunction · 0.70
_slow_runnerFunction · 0.70

Calls 4

SpanClass · 0.90
TraceStatusClass · 0.90
SpanContextClass · 0.90
OtelResourceClass · 0.90

Tested by

no test coverage detected