> ## Documentation Index
> Fetch the complete documentation index at: https://docs.idun-group.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Trace Detail

> Return the trace + its span tree.

Trace lookup uses the full 16-byte W3C id stored on
``standalone_trace``. The span query uses the trailing 8-byte slice
(``trace_id[8:]``) — that's the form the exporter persists onto
``standalone_span.otel_trace_id``.



## OpenAPI

````yaml /standalone/openapi.json get /admin/api/v1/traces/{otel_trace_id}
openapi: 3.1.0
info:
  title: Idun Agent Engine Server
  description: A production-ready server for conversational AI agents
  version: 0.6.1
servers: []
security: []
tags:
  - name: Runtime
    description: >-
      Public agent run endpoints, engine operations, and chat-channel webhooks.
      SSE streaming via the AG-UI protocol.
  - name: Agent Configuration
    description: >-
      Singleton admin endpoints for the agent, prompts, memory, guardrails, and
      onboarding wizard.
  - name: Auth & SSO
    description: >-
      Login, sessions, password change, SSO config, and the public SSO discovery
      endpoint.
  - name: Integrations & Tools
    description: MCP server registry and external integration credentials.
  - name: Observability
    description: Tracing/logging provider configuration.
  - name: Traces
    description: >-
      Trace and span storage admin endpoints — list, detail, delete, and
      pipeline-health for the standalone trace store.
  - name: Dashboard
    description: >-
      Operator dashboard widgets — KPIs, time-series, top errors, and
      configuration summary.
paths:
  /admin/api/v1/traces/{otel_trace_id}:
    get:
      tags:
        - Traces
      summary: Get Trace Detail
      description: |-
        Return the trace + its span tree.

        Trace lookup uses the full 16-byte W3C id stored on
        ``standalone_trace``. The span query uses the trailing 8-byte slice
        (``trace_id[8:]``) — that's the form the exporter persists onto
        ``standalone_span.otel_trace_id``.
      operationId: get_trace_detail_admin_api_v1_traces__otel_trace_id__get
      parameters:
        - name: otel_trace_id
          in: path
          required: true
          schema:
            type: string
            title: Otel Trace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandaloneTraceDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StandaloneTraceDetail:
      properties:
        trace:
          $ref: '#/components/schemas/StandaloneTraceListItem'
        tree:
          items:
            $ref: '#/components/schemas/StandaloneSpanTreeNode'
          type: array
          title: Tree
      type: object
      required:
        - trace
      title: StandaloneTraceDetail
      description: |-
        Body of ``GET /admin/api/v1/traces/{otel_trace_id}``.

        ``tree`` holds the top-level spans of the trace. Orphan spans
        (those whose ``parent_span_id`` is not present in the same trace,
        e.g. truncated traces or cross-trace links) are also surfaced as
        roots so the UI never silently hides them.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StandaloneTraceListItem:
      properties:
        otelTraceId:
          type: string
          title: Oteltraceid
        name:
          type: string
          title: Name
        startedAt:
          type: string
          format: date-time
          title: Startedat
        endedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Endedat
        latencyMs:
          anyOf:
            - type: number
            - type: 'null'
          title: Latencyms
        totalTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totaltokens
        totalCostUsd:
          anyOf:
            - type: number
            - type: 'null'
          title: Totalcostusd
        models:
          items:
            type: string
          type: array
          title: Models
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        userId:
          anyOf:
            - type: string
            - type: 'null'
          title: Userid
        sessionId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sessionid
        tags:
          items:
            type: string
          type: array
          title: Tags
      type: object
      required:
        - otelTraceId
        - name
        - startedAt
      title: StandaloneTraceListItem
      description: |-
        One row in ``GET /admin/api/v1/traces`` list response.

        ``otel_trace_id`` is the lowercase hex encoding of the 16-byte
        W3C trace id. The DB stores raw bytes; routers convert at the
        boundary so JSON consumers never see a binary blob.
    StandaloneSpanTreeNode:
      properties:
        span:
          $ref: '#/components/schemas/StandaloneSpanRead'
        children:
          items:
            $ref: '#/components/schemas/StandaloneSpanTreeNode'
          type: array
          title: Children
      type: object
      required:
        - span
      title: StandaloneSpanTreeNode
      description: |-
        Recursive node carrying a span and its children.

        The router builds the tree in Python from the flat recursive-CTE
        result. Depth is capped at 32 (decision ``§28``).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    StandaloneSpanRead:
      properties:
        otelSpanId:
          type: string
          title: Otelspanid
        otelTraceId:
          type: string
          title: Oteltraceid
        parentSpanId:
          anyOf:
            - type: string
            - type: 'null'
          title: Parentspanid
        name:
          type: string
          title: Name
        kind:
          type: string
          title: Kind
        startedAt:
          type: string
          format: date-time
          title: Startedat
        endedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Endedat
        latencyMs:
          anyOf:
            - type: number
            - type: 'null'
          title: Latencyms
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        promptTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prompttokens
        completionTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completiontokens
        cacheReadTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cachereadtokens
        cacheWriteTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cachewritetokens
        totalTokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Totaltokens
        costUsd:
          anyOf:
            - type: number
            - type: 'null'
          title: Costusd
        costBreakdown:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Costbreakdown
        costSource:
          anyOf:
            - type: string
            - type: 'null'
          title: Costsource
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Attributes
        events:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Events
      type: object
      required:
        - otelSpanId
        - otelTraceId
        - name
        - kind
        - startedAt
      title: StandaloneSpanRead
      description: |-
        One span read from the standalone_span table.

        ``otel_span_id`` and ``parent_span_id`` are 8-byte hex strings.
        ``otel_trace_id`` is the 8-byte slice of the parent trace id (the
        span table only stores the trailing half — see the exporter).

````