---
title: "Query trace spans with optional filters."
method: GET
path: "/otel/traces"
tags: ["Traces"]
---

# Query trace spans with optional filters.

`GET /otel/traces`

## Request

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

Each returned span has a `duration_ms` field (float, milliseconds) — this is
the ONLY field guaranteed to be in milliseconds. Spans also carry an
`attributes` map of raw key/value pairs exactly as reported by the
instrumenting library: numeric attribute values may be seconds, milliseconds,
microseconds, or nanoseconds depending on that library's convention, and
nothing in this response labels the unit. Never assume an attribute's
numeric value shares `duration_ms`'s unit, and never state a duration in
milliseconds unless it came from a `duration_ms` field.

## Query parameters

- `project_id` integer, required
- `trace_id` string
- `service_name` string
- `status` string
- `min_duration_ms` number, double
- `start_time` string
- `end_time` string
- `environment_id` integer
- `deployment_id` integer
- `attributes` string
- `name_pattern` string
- `limit` integer
- `offset` integer

## Response `200`

Trace spans

- 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`: 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-10-05** `63a80791dc58`: 3 warning
  - removed the optional property `status` from the response with the `401` status
  - removed the optional property `status` from the response with the `403` status
  - removed the optional property `status` from the response with the `500` status
- **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-07** `9e48d4ac62f9`: 2 info
  - added the new optional `query` request parameter `attributes`
  - added the new optional `query` request parameter `name_pattern`

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/otel/traces/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)
