{% extends "base.html" %} {% block content %} {% if trace %}
{{ trace.status }} Duration: {{ trace.total_duration_ms | default('-') }}ms Cost: ${{ "%.6f" | format(trace.total_cost | default(0) | float) }} Tokens: {{ "{:,}".format(trace.total_input_tokens | default(0) | int) }}in / {{ "{:,}".format(trace.total_output_tokens | default(0) | int) }}out ({{ "{:,}".format(trace.total_tokens | default(0) | int) }} total) Spans: {{ trace.span_count | default(0) }}
Trace: {{ trace.trace_id }}
Created: {{ trace.created_at }}
{% if trace.entry_input %}

Input

{{ trace.entry_input }}
{% endif %} {% if trace.final_output %}

Output

{{ trace.final_output }}
{% endif %} {# ══════════════════════════════════════════════════════════════ RECURSIVE SPAN MACRO — renders a span and all its children ══════════════════════════════════════════════════════════════ #} {% macro render_span(span, tool_calls, is_last) %}
{# ── Connector line ── #}
{# ── Span content ── #}
{# ── Header row ── #}
{% if span.span_type == 'agent' %} AGENT {% elif span.span_type == 'llm' %} LLM {% else %} TOOL {% endif %} {{ span.component_class }} "{{ span.component_name }}" ({{ span.duration_ms | default('?') }}ms) {{ span.status }} {% if span.input_tokens %} {{ span.input_tokens }}in / {{ span.output_tokens | default(0) }}out{% if span.cached_tokens %} ({{ span.cached_tokens }} cached){% endif %} {% endif %} {% if span.total_cost %} ${{ "%.6f" | format(span.total_cost | float) }} {% endif %}
{# ── Waterfall timeline bar ── #} {% if span.waterfall_left_pct is defined and span.waterfall_width_pct is defined %}
{% endif %} {# ── Expandable details ── #} {# end span-details #} {# ── Children (recursive) ── #} {% if span.children %}
{% for child in span.children %} {{ render_span(child, tool_calls, loop.last) }} {% endfor %}
{% endif %}
{# end tree-body #}
{# end tree-node #} {% endmacro %} {# ══════════════════════════════════════════════════════════════ #}

Chain View

{% for span in root_spans %} {{ render_span(span, tool_calls, loop.last) }} {% endfor %}
{% else %}

Trace not found.

{% endif %} {% endblock %}