---
title: "Inspect session MLflow trace mapping"
method: GET
path: "/api/v1/sessions/{session_id}/trace-debug"
tags: ["sessions"]
---

# Inspect session MLflow trace mapping

`GET /api/v1/sessions/{session_id}/trace-debug`

Resolve one MLflow trace for the session and classify each span against the workspace chat component model.

## Path parameters

- `session_id` string, required — Identifier of the session whose trace to inspect.

## Query parameters

- `trace_id` string, nullable — Optional explicit MLflow trace id to inspect.
- `client_request_id` string, nullable — Optional Fleet client request id used to resolve the trace.

## Response `200`

Successful Response

- SessionTraceDebugResponse — Session-scoped MLflow trace debug summary for chat component mapping.
  - `trace_id` string, required — Resolved MLflow trace identifier.
  - `client_request_id` string, nullable — Resolved Fleet client request identifier when available.
  - `state` string, nullable — Top-level MLflow trace state.
  - `request_preview` string, nullable — Trace request preview.
  - `response_preview` string, nullable — Trace response preview.
  - `resolved_from` 'trace_id' | 'client_request_id' | 'session_row' | 'runtime_session_id', required — How the trace was resolved for this session debug request.
  - `runtime_session_id` string, nullable — Authorized runtime session id used for fallback lookup when applicable.
  - `span_count` integer, required — Total spans in the resolved trace.
  - `renderable_span_count` integer, required — How many spans map to a renderable chat component.
  - `non_rendered_span_count` integer, required — How many spans are intentionally observability-only.
  - `performance_summary` SessionTracePerformanceSummary, required — Performance and token summary derived from raw MLflow trace spans.
    - `total_duration_ms` integer, nullable — Root trace duration in milliseconds.
    - `llm_duration_ms` integer — Total duration of LLM/chat-model spans.
    - `repl_duration_ms` integer — Total duration of REPL execution spans.
    - `tool_duration_ms` integer — Total duration of non-REPL tool spans.
    - `root_overhead_ms` integer, nullable — Root duration minus known LLM, REPL, and tool durations.
    - `input_tokens` integer — Summed input tokens from span usage.
    - `output_tokens` integer — Summed output tokens from span usage.
    - `total_tokens` integer — Summed total tokens from span usage.
    - `token_total_mismatch` boolean — Whether total_tokens differs from input_tokens + output_tokens.
    - `adapter_fallback_count` integer — Detected adapter fallback or retry signals.
    - `parse_error_count` integer — Detected parser/adapter parse error signals.
    - `selected_skills` string[] — Selected RLM skill names.
    - `rlm_action_max_tokens` integer, nullable — Configured RLM action-generation token budget.
    - `rlm_max_output_chars` integer, nullable — Configured RLM REPL output character budget.
    - `slowest_llm_span` SessionTracePerformanceSpanSummary — Compact span reference used in trace performance summaries.
      - `span_id` string, required — Span identifier.
      - `name` string, required — Span name.
      - `duration_ms` integer, nullable — Span duration in milliseconds.
      - `input_tokens` integer, nullable — Input token count.
      - `output_tokens` integer, nullable — Output token count.
      - `total_tokens` integer, nullable — Total token count.
      - `output_chars` integer, nullable — Output payload character count.
    - `largest_output_span` SessionTracePerformanceSpanSummary — Compact span reference used in trace performance summaries.
      - `span_id` string, required — Span identifier.
      - `name` string, required — Span name.
      - `duration_ms` integer, nullable — Span duration in milliseconds.
      - `input_tokens` integer, nullable — Input token count.
      - `output_tokens` integer, nullable — Output token count.
      - `total_tokens` integer, nullable — Total token count.
      - `output_chars` integer, nullable — Output payload character count.
  - `spans` SessionTraceDebugSpan[], required — Per-span mapping summary.
    - `span_id` string, required — MLflow/OpenTelemetry span identifier.
    - `parent_span_id` string, nullable — Parent span identifier when present.
    - `name` string, required — Span name.
    - `span_type` string, nullable — MLflow span type when present.
    - `status_code` string, nullable — Span status code.
    - `tool_name` string, nullable — Resolved tool name when the span is tool-like.
    - `mapped_render_kind` 'assistant_text' | 'reasoning' | 'tool' | 'sandbox' | 'status_note' | 'non_rendered', required — Frontend chat render kind the span most closely maps to.
    - `mapped_component_type` string, nullable — Frontend Agent Elements component/tool type hint when renderable.
    - `rationale` string, required — Why the span is rendered or intentionally not rendered.
    - `input_preview` string, nullable — Compact preview of span inputs.
    - `output_preview` string, nullable — Compact preview of span outputs.
    - `start_time_unix_nano` string, nullable — Span start timestamp (Unix nanoseconds, string-encoded).
    - `end_time_unix_nano` string, nullable — Span end timestamp (Unix nanoseconds, string-encoded).
    - `duration_ms` integer, nullable — Span duration in milliseconds when timestamps exist.
    - `input_tokens` integer, nullable — Input token count reported for this span.
    - `output_tokens` integer, nullable — Output token count reported for this span.
    - `total_tokens` integer, nullable — Total token count reported for this span.
    - `output_chars` integer, nullable — Character count of the raw span output payload.
    - `retry_or_fallback_reason` string, nullable — Parse, retry, or adapter fallback signal detected for this span.

## Other responses

- `401` — Authentication is required or the provided token is invalid.
- `403` — The caller does not have permission to access this resource.
- `404` — Session not found.
- `422` — Validation Error
- `503` — Session services are unavailable because server startup is incomplete.

---

[API](https://skmtc.net/qredence/apis/fleet-rlm.md) · [All operations](https://skmtc.net/qredence/apis/fleet-rlm/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qredence/fleet-rlm/versions/62e8c152aa18/schema)
