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

Function make_span

tests/store/test_core.py:1674–1694  ·  view source on GitHub ↗
(rollout_id: str, attempt_id: str, idx: int, name: str)

Source from the content-addressed store, hash-verified

1672 second = await store_fixture.start_rollout(input={"payload": "second-span"})
1673
1674 def make_span(rollout_id: str, attempt_id: str, idx: int, name: str) -> Span:
1675 span_hex = f"{idx:016x}"
1676 trace_hex = f"{idx:032x}"
1677 return Span(
1678 rollout_id=rollout_id,
1679 attempt_id=attempt_id,
1680 sequence_id=idx,
1681 trace_id=trace_hex,
1682 span_id=span_hex,
1683 parent_id=None,
1684 name=name,
1685 status=TraceStatus(status_code="OK"),
1686 attributes={},
1687 events=[],
1688 links=[],
1689 start_time=None,
1690 end_time=None,
1691 context=SpanContext(trace_id=trace_hex, span_id=span_hex, is_remote=False, trace_state={}),
1692 parent=None,
1693 resource=OtelResource(attributes={}, schema_url=""),
1694 )
1695
1696 span_first = make_span(first.rollout_id, first.attempt.attempt_id, 1, "alpha")
1697 span_second = make_span(second.rollout_id, second.attempt.attempt_id, 2, "beta")

Calls 4

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

Tested by

no test coverage detected