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

# Get Trace

> Get details for a specific trace or a span within a time range.

Requires a valid JWT token with the `read:traces` permission.

The search is limited to spans where `span_start_time` falls within 
the specified time range. If `span_id` is provided, returns only the
data for that specific span as a single-element list.



## OpenAPI

````yaml GET /traces/{trace_id}
openapi: 3.1.0
info:
  title: Unomiq Engine API
  description: >-

    API for managing OpenTelemetry data, queries and boards.


    ## Authentication


    All API endpoints require authentication via JWT token in the Authorization
    header:


    ```

    Authorization: Bearer <your_jwt_token>

    ```


    Obtain your JWT token from the authentication service and include it in all
    requests.
        
  version: 1.0.0
servers:
  - url: https://engine-api.unomiq.com
    description: Production
security: []
paths:
  /traces/{trace_id}:
    get:
      tags:
        - traces
      summary: Get Trace
      description: |-
        Get details for a specific trace or a span within a time range.

        Requires a valid JWT token with the `read:traces` permission.

        The search is limited to spans where `span_start_time` falls within 
        the specified time range. If `span_id` is provided, returns only the
        data for that specific span as a single-element list.
      operationId: get_trace_traces__trace_id__get
      parameters:
        - name: trace_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{32}$
            description: OpenTelemetry trace identifier (32-character hexadecimal string)
            examples:
              - 4bf92f3577b34da6a3ce929d0e0e4736
            title: Trace Id
          description: OpenTelemetry trace identifier (32-character hexadecimal string)
        - name: start_time
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: Start datetime (inclusive)
            examples:
              - '2025-01-15T00:00:00Z'
            title: Start Time
          description: Start datetime (inclusive)
        - name: end_time
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: End datetime (exclusive)
            examples:
              - '2025-01-16T00:00:00Z'
            title: End Time
          description: End datetime (exclusive)
        - name: span_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^[a-fA-F0-9]{16}$
              - type: 'null'
            description: >-
              OpenTelemetry span identifier (16-character hexadecimal string).
              If provided, returns only the data for this specific span.
            examples:
              - 5ab41c652fedc2af
            title: Span Id
          description: >-
            OpenTelemetry span identifier (16-character hexadecimal string). If
            provided, returns only the data for this specific span.
        - name: X-Unomiq-App-Id
          in: header
          required: true
          schema:
            type: string
            title: X-Unomiq-App-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trace'
                title: Response Get Trace Traces  Trace Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Trace:
      properties:
        trace_id:
          type: string
          title: Trace Id
        span_id:
          type: string
          title: Span Id
        span_start_time_unix_nano:
          type: integer
          title: Span Start Time Unix Nano
        span_end_time_unix_nano:
          type: integer
          title: Span End Time Unix Nano
        duration_ms:
          type: number
          title: Duration Ms
        parent_span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Span Id
        span_name:
          type: string
          title: Span Name
        span_kind:
          type: string
          title: Span Kind
        service_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Name
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        parent_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Unit
        resource_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Resource Attributes
        span_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Span Attributes
        cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cost
        billing:
          $ref: '#/components/schemas/BillingInfo'
        usage:
          $ref: '#/components/schemas/UsageInfo'
      type: object
      required:
        - trace_id
        - span_id
        - span_start_time_unix_nano
        - span_end_time_unix_nano
        - duration_ms
        - span_name
        - span_kind
      title: Trace
      description: Trace domain model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BillingInfo:
      properties:
        resource_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Type
        resource_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Name
        service_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Id
        service_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Name
        sku_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku Id
        sku_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku Name
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
      type: object
      title: BillingInfo
      description: Billing information associated with a span.
    UsageInfo:
      properties:
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
      type: object
      title: UsageInfo
      description: Usage information associated with a span.
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````