---
title: "Get a list of trace spans."
method: GET
path: "/v1/tracing/traces/{traceId}/spans"
tags: ["traces"]
---

# Get a list of trace spans.

`GET /v1/tracing/traces/{traceId}/spans`

Get a list of spans for the given trace. The response is paginated with a default limit of 100 spans per page.

## Path parameters

- `traceId` string, required

## Query parameters

- `limit` integer
- `token` string

## Response `200`

List of spans for the given trace.

- TraceSpansResponse
  - `spanPage` TraceSpan[] — List of trace spans.
    - `id` string, required — Identifier of the span.
    - `parentId` string — Identifier of the parent span, if any. If the span has no parent it's considered a root span.
    - `operationName` string, required — The name of the operation given to the span.
    - `resource` string — The name of the resource attached to the span.
    - `service` string — The name of the service this span is part of.
    - `serviceColor` string — Color hex code assigned to the service.
    - `serviceType` string — Defines type of service.
    - `duration` integer, required — Number of nanoseconds the span lasted.
    - `startedAt` string, date-time, required — Date and time the span was started in the [ISO 8601 / RFC3339](https://tools.ietf.org/html/rfc3339) format.
    - `status` TraceSpanStatus, required
      - `code` string, required — Status code of the span. Possible values: `OK`, `ERROR`, `UNKNOWN`.
      - `message` string — Optional descriptive message about the status, could be an http status code or the kind of an error, e.g. OSError.
    - `kind` string — Span kind describes the relationship between the Span, its parents, and its children in a Trace. Possible values: `CLIENT`, `SERVER`, `PRODUCER`, `CONSUMER`, `INTERNAL`.
    - `remoteService` string — Name of the possible remote span's service.
    - `remoteServiceColor` string — Color hex code assigned to the remote service.
    - `remoteServiceType` string — Defines type of service.
    - `info` TraceSpanInfo
      - `type` string, required — Type of this span. Possible values: `TraceHttpSpanInfo`, `TraceDbSpanInfo`, `TraceMessageBusSpanInfo`.
    - `numberOfLinks` integer — Number of span links in this span.
  - `totalCount` integer, required — Total count of spans for this trace.
  - `next` string — Next continuation token.

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/versions/18a824df1e78/schema)
