(idx: int, *, name: str, parent: Optional[str])
| 1608 | attempt_id = attempted.attempt.attempt_id |
| 1609 | |
| 1610 | def build_span(idx: int, *, name: str, parent: Optional[str]) -> Span: |
| 1611 | trace_hex = f"{idx:032x}" |
| 1612 | span_hex = f"{idx:016x}" |
| 1613 | return Span( |
| 1614 | rollout_id=attempted.rollout_id, |
| 1615 | attempt_id=attempt_id, |
| 1616 | sequence_id=idx, |
| 1617 | trace_id=trace_hex, |
| 1618 | span_id=span_hex, |
| 1619 | parent_id=parent, |
| 1620 | name=name, |
| 1621 | status=TraceStatus(status_code="OK"), |
| 1622 | attributes={}, |
| 1623 | events=[Event(name=f"event-{idx}", attributes={})], |
| 1624 | links=[], |
| 1625 | start_time=None, |
| 1626 | end_time=None, |
| 1627 | context=SpanContext(trace_id=trace_hex, span_id=span_hex, is_remote=False, trace_state={}), |
| 1628 | parent=None, |
| 1629 | resource=OtelResource(attributes={}, schema_url=""), |
| 1630 | ) |
| 1631 | |
| 1632 | created_spans = [ |
| 1633 | build_span(1, name="reward", parent=None), |
no test coverage detected