{% extends "generic/object_retrieve.html" %} {% load static %} {% load ui_framework %} {% block extra_styles %} {{ block.super }} {% endblock %} {% block breadcrumbs_wrapper %}{% render_breadcrumbs %}{% endblock %} {% block header %}{% endblock %} {% block content %} {% url "plugins:nautobot_agent:agentexecutiontrace_list" as traces_url %}

Execution trace {{ trace.pk }}

{% if trace_conversation %}{{ trace_conversation.title|default:'Untitled conversation' }}{% else %}Conversation{% endif %}

Started {{ trace.started_at|date:"DATETIME_FORMAT" }} · {{ trace.conversation.user.username }}

{% if position %}

Turn {{ position.number }} of {{ position.total }}

{% endif %}
{% if not full_access %}

Trace summary

Execution: {{ trace.execution_label }}

Diagnostics: {{ trace.get_capture_state_display }}

{% if trace.capture_state == "pending" and trace.status != "running" %}

The execution has ended; saving its trace details has not been confirmed. Refresh later, or check server logs if this persists.

{% endif %}

Duration: {{ trace.duration_seconds|floatformat:2|default:"Unknown" }} s.

Full span and payload inspection requires both trace and span view permissions.

{% else %} {% if trace.status == "running" %}

This execution is still running. Spans are persisted when the execution finishes; refresh manually to update this view.

{% endif %} {% if trace.capture_state == "pending" and trace.status != "running" %}

The execution has ended; saving its trace details has not been confirmed. Refresh later, or check server logs if this persists.

{% endif %} {% if trace_overview.has_integrity_anomalies %}

Recorded parent relationships contain integrity anomalies; all spans are shown.

{% endif %}
{% if include_tree %}

Execution overview

{{ trace_overview.span_count }} spans
{% if not trace_overview.span_count %}

No spans were recorded for this execution.

{% endif %}
{{ trace_overview.root_count }} recorded roots · {{ trace_overview.event_count }} captured callback events
{% endif %}

{% if selected_span %}{{ selected_span.name }}{% else %}Execution overview{% endif %}

{% if selected_span %}{{ selected_span.status_label }}{% else %}{{ trace.execution_label }}{% endif %}
Duration
{% if selected_span %}{{ selected_span.duration_seconds|floatformat:2 }}{% else %}{{ trace.duration_seconds|floatformat:2|default:"Unknown" }}{% endif %} s
{% if selected_span %}
Tokens
{% if selected_span.usage %}{{ selected_span.usage.input_tokens|default_if_none:"?" }} input / {{ selected_span.usage.output_tokens|default_if_none:"?" }} output{% else %}Unknown{% endif %}
Reported cost
{{ selected_span.reported_costs_preview.preview }}
{% if selected_span.reported_costs_preview.incomplete %}Display preview{% endif %}
{% endif %}
{% if not selected_span %} {% if trace.capture_state == "partial" %}

Some trace details are unavailable. Check server logs for details.

{% elif trace.capture_state == "failed" %}

Trace details could not be saved. Check server logs for details.

{% endif %} {% endif %}
{# Keep button tabs out of core's anchor-only .nav.nav-tabs collapse/cloning handler. #}
{% if selected_span.kind == "chain" %}

Chain input and output were not captured.

{% endif %} {% for payload in payloads %}
{{ payload.kind|title }} JSON{% if payload.incomplete %} (display preview){% endif %} {% if payload.available %}
{% if payload.incomplete %}Display preview{% endif %} {% include "nautobot_agent/inc/trace_payload_links.html" with field=payload.kind %}
{{ payload.preview }}
{% else %}

No {{ payload.kind }} value was recorded.

{% endif %}
{% endfor %}

Metadata

Timing

Durations are derived from start/end timestamps, not the sum of overlapping child spans.

Recorded token usage

{% if selected_span %} {% if selected_span.usage %}{% else %}

No unambiguous model usage was recorded for this span.

{% endif %} {% else %} {% if trace_overview.model_call_count %}

Known subtotal from {{ trace_overview.model_call_count }} model calls; {{ trace_overview.usage_missing_calls }} calls without unambiguous usage.

{% else %}

No recorded model usage.

{% endif %} {% endif %}

Reported cost (not estimated or summed)

{% if selected_span %}
{{ selected_span.reported_costs_preview.preview }}
{% if selected_span.reported_costs_preview.incomplete %}Display preview{% endif %}{% else %}
{{ trace_overview.reported_costs_preview.preview }}
{% if trace_overview.reported_costs_preview.incomplete %}Display preview{% endif %}{% endif %}

Callback events

{% if selected_span %}
{{ selected_span.events_preview.preview }}
{% if selected_span.events_preview.incomplete %}Display preview{% endif %}

The complete details JSON includes the retained callback events.

{% if selected_span.metadata_preview.available %}{% include "nautobot_agent/inc/trace_payload_links.html" with field="details" %}{% endif %}

Original event counters

{{ selected_span.event_counts_preview.preview }}
{% if selected_span.event_counts_preview.incomplete %}Display preview{% endif %} {% if selected_span.event_counts_preview.available %}{% include "nautobot_agent/inc/trace_payload_links.html" with field="event_counts" %}{% endif %} {% else %}

{{ trace_overview.event_count }} captured callback events. Select a span to inspect its history.

{% endif %}
{% if selected_span.children %}{% endif %}
{% endif %}
{% endblock %} {% block javascript %} {{ block.super }} {% endblock %}