Skip to content

readable_spans_to_trace

autogen.beta.eval.sources._otel.readable_spans_to_trace #

readable_spans_to_trace(spans, *, conventions=None, duration_ms=None)

Reconstruct a :class:Trace from a list of OpenTelemetry ReadableSpan.

Source code in autogen/beta/eval/sources/_otel.py
def readable_spans_to_trace(
    spans: Sequence[ReadableSpan],
    *,
    conventions: Sequence[SpanConvention] | None = None,
    duration_ms: int | None = None,
) -> Trace:
    """Reconstruct a :class:`Trace` from a list of OpenTelemetry ``ReadableSpan``."""
    return spans_to_trace([readable_span_to_data(s) for s in spans], conventions=conventions, duration_ms=duration_ms)