Trace ID: {{ trace.trace_id }}
{% if trace.request_id %}
Request: {{ trace.request_id }}
{% endif %}
{% if trace.user_id %}
User: {{ trace.user_id }}
{% endif %}
{% if trace.session_id %}
Session: {{ trace.session_id }}
{% endif %}
{% for span in trace.get_annotated_spans() %}
{% set span_start_offset = ((span.start_time - trace.start_time).total_seconds() * 1000) %}
{% set start_percent = (span_start_offset / trace.duration_ms() * 100) if trace.duration_ms() > 0 else 0 %}
{% set width_percent = (span.duration_ms() / trace.duration_ms() * 100) if trace.duration_ms() > 0 else 0 %}
{{ span.start_time|localtime|strftime("%-I:%M:%S %p") }}
{{ span.name }}
{% if span.annotations %}
{% for annotation in span.annotations %}
!
{% endfor %}
{% endif %}
{{ "%.2f"|format(span.duration_ms()) }}ms
{% if span.sql_query %}
Database Query
{% if span.annotations %}
{% for annotation in span.annotations %}
{{ annotation.message }}
{% endfor %}
{% endif %}
{{ span.get_formatted_sql() }}
{% if span.sql_query_params %}
Query Parameters
{% for param_key, param_value in span.sql_query_params.items() %}
{{ param_key }}:
{{ param_value }}
{% endfor %}
{% endif %}
{% endif %}
{% if span.get_exception_stacktrace() %}
{{ span.get_exception_stacktrace() }}
{% endif %}
Basic Information
ID:
{{ span.span_id }}
Name:
{{ span.name }}
Kind:
{{ span.kind }}
Duration:
{{ "%.2f"|format(span.duration_ms() or 0) }}ms
{% if span.parent_id %}
Parent:
{{ span.parent_id }}
{% endif %}
Timing
Started:
{{ span.start_time|localtime|strftime("%-I:%M:%S.%f %p") }}
Ended:
{{ span.end_time|localtime|strftime("%-I:%M:%S.%f %p") }}
{% if span.status and span.status != '' and span.status != 'UNSET' %}
Status:
{{ span.status }}
{% endif %}
{% if span.attributes %}
Attributes
{% for key, value in span.attributes.items() %}
{{ key }}:
{{ value }}
{% endfor %}
{% endif %}
{% if span.events %}
Events ({{ span.events|length }})
{% for event in span.events %}
{{ event.name }}
{% set formatted_time = span.format_event_timestamp(event.timestamp) %}
{% if formatted_time.__class__.__name__ == 'datetime' %}
{{ formatted_time|localtime|strftime("%-I:%M:%S.%f %p") }}
{% else %}
{{ formatted_time }}
{% endif %}
{% if event.attributes %}
{% for key, value in event.attributes.items() %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if span.links %}
Links ({{ span.links|length }})
{% for link in span.links %}
{{ link.context.trace_id }}
{{ link.context.span_id }}
{% endfor %}
{% endif %}
{% else %}
No spans...
{% endfor %}