dots.v2.insights.query.byRegion().traces.byTrace_id().get()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.insights.query.byRegion(region).traces.byTrace_id(trace_id).get(requestConfiguration?: RequestConfiguration<WithTrace_ItemRequestBuilderGetQueryParameters>): Promise<undefined | Traces_trace_response>

Description

To retrieve a single trace and all of its spans, send a GET request to /v2/insights/query/{region}/traces/{trace_id}. Only spans that started within the lookup window are returned. The window defaults to the last 7 days and can be narrowed with the from and to query parameters; it must not exceed 7 days, and from must not be after to. Spans are returned ordered by start time. At most 10,000 spans are returned; truncated is true when the trace has more. A trace ID with no spans in the window returns 404, as do malformed or uppercase trace IDs. A trace is only resolvable in the region that ingested it; querying another region also returns 404. Supported regions are ams2, ams3, atl1, blr1, fra1, lon1, mem1, nyc1, nyc2, nyc3, ric1, sfo1, sfo2, sfo3, sgp1, syd1, and tor1. Requests time out after 60 seconds. Errors produced by the traces service (400, and 404 when no trace is found) have a text/plain body containing a short message. Authentication and authorization errors (401, 403), rate limiting (429), and routing errors (for example, 404 for an unknown region) come from the API gateway and use the standard JSON error object with id and message. 403 is also returned for accounts that are in a trial or not in good standing. If the regional traces backend cannot be reached, the response is 502 with a text/plain body. JSON field names use snake_case (trace_id, span_id, start_time, end_time, duration_ns, service_name, status_code, parent_span_id).

Parameters

Path Parameters

region string required

Example: nyc3

The datacenter region slug for the query.

trace_id string required

Example: 7b0b4e56abab38362b24e5498eb9ec64

The OpenTelemetry trace ID to retrieve, as 32 lowercase hexadecimal characters. IDs are matched exactly; an ID with no spans in the lookup window returns 404. Malformed or uppercase IDs are not rejected with 400; they also return 404.

Query Parameters

from string optional

Example: 24h

Start of the trace lookup window. Accepts a relative time (now, a bare duration such as 24h to look back from now, or now-2h) or an absolute time (RFC3339, or a Unix epoch integer in seconds, milliseconds, microseconds, or nanoseconds). Defaults to 7 days before now.

to string optional

Example: now

End of the trace lookup window, in the same formats as from. Defaults to now.

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.insights.query
    .byRegion("nyc3").traces
    .byTrace_id("7b0b4e56abab38362b24e5498eb9ec64").get();

Response Example

Show Response Example
{
  "trace_id": "7b0b4e56abab38362b24e5498eb9ec64",
  "spans": [
    {
      "trace_id": "7b0b4e56abab38362b24e5498eb9ec64",
      "span_id": "e7867486e45cda47",
      "parent_span_id": "a2fb4a1d1a96d312",
      "start_time": "2026-10-09T06:44:37Z",
      "end_time": "2026-10-09T06:44:39Z",
      "duration_ns": 200000000,
      "name": "GET /checkout",
      "kind": "Server",
      "status_code": "Error",
      "status_message": "upstream timeout",
      "service_name": "checkout-api",
      "resource": {
        "service.name": "checkout-api"
      },
      "attributes": {
        "http.method": "GET"
      }
    }
  ],
  "truncated": false
}

More Information

See /v2/insights/query/{region}/traces/{trace_id} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.