---
title: "Get all spans for a specific trace."
method: GET
path: "/otel/traces/{project_id}/{trace_id}"
tags: ["Traces"]
---

# Get all spans for a specific trace.

`GET /otel/traces/{project_id}/{trace_id}`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/otel/traces/{project_id}/{trace_id}`
- Auth: HTTP bearer

Each span has a `duration_ms` field (float, milliseconds) — the ONLY field
guaranteed to be in milliseconds — plus an `attributes` map of raw
key/value pairs exactly as the instrumenting library reported them.
Numeric attribute values (e.g. connection-pool wait times, queue delays)
may be in seconds, milliseconds, microseconds, or nanoseconds depending on
that library's own convention; this response never labels the unit. When
explaining what a span spent time on, only quote milliseconds from
`duration_ms` (or from `start_time`/`end_time` deltas) — never assume a raw
attribute number is already in milliseconds.

## Path parameters

- `project_id` integer, required
- `trace_id` string, required

## Query parameters

- `start_time` string
- `end_time` string

## Response `200`

Trace spans tree

- TracesResponse
  - `count` integer, required
  - `data` SpanRecord[], required
    - `attributes` object, required: Raw key/value pairs exactly as reported by the instrumenting library. Numeric values are NOT guaranteed to share `duration_ms`'s unit — they may be seconds, milliseconds, microseconds, or nanoseconds depending on the exporter's own convention, and the unit is not labeled here.
    - `deployment_id` integer, nullable
    - `duration_ms` number, double, required: Span duration in milliseconds. The only field on this struct guaranteed to be in milliseconds.
    - `end_time` string, date-time, required
    - `events` SpanEvent[], required
      - `attributes` object, required
      - `name` string, required
      - `timestamp` string, date-time, required
    - `kind` 'UNSPECIFIED' | 'INTERNAL' | 'SERVER' | 'CLIENT' | 'PRODUCER' | 'CONSUMER', required: Span kind.
    - `name` string, required
    - `parent_span_id` string, nullable
    - `project_id` integer, required
    - `resource` ResourceInfo, required: Resource attributes extracted from OTel resource descriptors.
      - `attributes` object, required
      - `deployment_environment` string, nullable
      - `service_name` string, required
      - `service_version` string, nullable
    - `span_id` string, required
    - `start_time` string, date-time, required
    - `status_code` 'UNSET' | 'OK' | 'ERROR', required: Span status code.
    - `status_message` string, required
    - `trace_id` string, required

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 3 breaking
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `500` status
- **2026-10-05** `4b228ebed583`: 5 info
  - added the new optional `query` request parameter `end_time`
  - added the new optional `query` request parameter `start_time`
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - …1 more
- **2026-10-05** `63a80791dc58`: 5 warning
  - deleted the `query` request parameter `end_time`
  - deleted the `query` request parameter `start_time`
  - removed the optional property `status` from the response with the `401` status
  - removed the optional property `status` from the response with the `403` status
  - …1 more
- **2026-09-23** `f4efc4d5c7b7`: 3 info
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - added the optional property `status` to the response with the `500` status
- **2026-09-20** `92a0a5fc2ba0`: 2 info
  - added the new optional `query` request parameter `end_time`
  - added the new optional `query` request parameter `start_time`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/otel/traces/:project_id/:trace_id/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
