dots.v2.insights.query.byRegion().traces.search.post()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.insights.query.byRegion(region).traces.search.post(body: Traces_search_request, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | Traces_search_response>

Description

To search traces in a region, send a POST request to /v2/insights/query/{region}/traces/search with a JSON body describing the time range, optional filter, ordering, and pagination. Each result is one trace, aggregated from all of its spans in the time range. A trace is included when at least one of its spans matches filter. The time range must not exceed 7 days (168h). pagination.limit defaults to 100 (also used when limit is 0) and must be between 0 and 1000. Results are ordered by started descending unless order_by is set. JSON field names use snake_case (time_range, order_by, has_more, trace_id). Unknown request properties, invalid filters, and out-of-range values are rejected with 400. Each request searches a single region; there is no multi-region search. 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) 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.

Parameters

Path Parameters

region string required

Example: nyc3

The datacenter region slug for the query.

Request Body

timeRange object required

An inclusive query time window. Both bounds are required, from must not be after to, and the window must not exceed 7 days (168h).

Show child properties
from object required

A single point in time. Set absolute or relative; if both are set, absolute is used.

Show child properties
absolute string optional

Example: 2026-10-09T00:00:00Z

An absolute timestamp, either RFC3339 (with optional fractional seconds) or a Unix epoch integer as a decimal string. Epoch precision is inferred from magnitude: seconds, milliseconds, microseconds, or nanoseconds.

relative string optional

Example: 15m

A time relative to now. Use now for the current time, a bare duration such as 15m or 24h to look back from now, or an offset such as now-2h or now+30m. Supported units are s, m, h, d, and w; decimal amounts such as 1.5h are allowed.

to object required

A single point in time. Set absolute or relative; if both are set, absolute is used.

Show child properties
absolute string optional

Example: 2026-10-09T00:00:00Z

An absolute timestamp, either RFC3339 (with optional fractional seconds) or a Unix epoch integer as a decimal string. Epoch precision is inferred from magnitude: seconds, milliseconds, microseconds, or nanoseconds.

relative string optional

Example: 15m

A time relative to now. Use now for the current time, a bare duration such as 15m or 24h to look back from now, or an offset such as now-2h or now+30m. Supported units are s, m, h, d, and w; decimal amounts such as 1.5h are allowed.

filter object optional

A boolean filter tree for traces queries. Exactly one node is set per message. Trees may be nested at most 16 levels deep and contain at most 256 nodes in total.

Show child properties
condition object optional

A single field comparison in a traces filter expression.

Show child properties
field object required

A reference to a span field, used in filters and order_by.

Show child properties
name string required

Example: service.name

The field name. Without scope, these names (case-insensitive) resolve to built-in span columns: trace_id, span_id, parent_span_id, start_time, end_time, duration_ns, name (span.name), kind (span.kind), status_code (status.code, status_code), status_message, and service_name (service.name). Any other name is looked up as a span attribute, falling back to a resource attribute. With scope set, name is always treated as an attribute key. Attribute keys may contain only letters, digits, and ., _, -, /, :, @.

In traces order_by, name must be a trace-level sort field instead; see the order_by field description.

scope string optional

Restricts the lookup to one attribute map and is matched case-insensitively. FIELD_SCOPE_RESOURCE reads resource attributes and accepts resource or resource.attributes as aliases. FIELD_SCOPE_ATTRIBUTES reads span attributes and accepts attribute, attributes, or span.attributes as aliases. Omit to use the built-in column mapping described for name. Ignored in traces order_by.

One of: FIELD_SCOPE_RESOURCE, FIELD_SCOPE_ATTRIBUTES, resource, resource.attributes, attribute, attributes, span.attributes

operator string required

The comparison operator.

One of: FILTER_OPERATOR_EQ, FILTER_OPERATOR_NEQ, FILTER_OPERATOR_IN, FILTER_OPERATOR_EXISTS, FILTER_OPERATOR_GTE, FILTER_OPERATOR_LTE

value object optional

A typed literal or list value for a traces filter condition. Exactly one kind is set per message.

Show child properties
stringValue string optional

Example: checkout-api

numberValue number optional

Example: 500000000

stringArrayValue object optional

Additional nested properties are not shown.

numberArrayValue object optional

Additional nested properties are not shown.

and object optional
Show child properties
expressions array of objects required

Additional nested properties are not shown.

or object optional
Show child properties
expressions array of objects required

Additional nested properties are not shown.

not object optional

A boolean filter tree for traces queries. Exactly one node is set per message. Trees may be nested at most 16 levels deep and contain at most 256 nodes in total.

Additional nested properties are not shown.

textSearch object optional

A substring search across span names, service names, and status messages.

Show child properties
query string required

Example: timeout

The search string. Leading and trailing whitespace is trimmed, and the remaining string must not be empty.

Min length: 1

Max length: 256

orderBy array of objects optional

Sort clauses applied in order. Defaults to started descending.

Show child properties
field object required

A reference to a span field, used in filters and order_by.

Show child properties
name string required

Example: service.name

The field name. Without scope, these names (case-insensitive) resolve to built-in span columns: trace_id, span_id, parent_span_id, start_time, end_time, duration_ns, name (span.name), kind (span.kind), status_code (status.code, status_code), status_message, and service_name (service.name). Any other name is looked up as a span attribute, falling back to a resource attribute. With scope set, name is always treated as an attribute key. Attribute keys may contain only letters, digits, and ., _, -, /, :, @.

In traces order_by, name must be a trace-level sort field instead; see the order_by field description.

scope string optional

Restricts the lookup to one attribute map and is matched case-insensitively. FIELD_SCOPE_RESOURCE reads resource attributes and accepts resource or resource.attributes as aliases. FIELD_SCOPE_ATTRIBUTES reads span attributes and accepts attribute, attributes, or span.attributes as aliases. Omit to use the built-in column mapping described for name. Ignored in traces order_by.

One of: FIELD_SCOPE_RESOURCE, FIELD_SCOPE_ATTRIBUTES, resource, resource.attributes, attribute, attributes, span.attributes

direction string optional

The sort direction, matched case-insensitively. Omit to use the server default.

One of: asc, desc

pagination object optional

Limits the size of a traces search result set. There is no cursor; use pagination.has_more in the response to tell whether more traces matched, and narrow the time range or filter to see them.

Show child properties
limit integer optional

Example: 50

Maximum number of traces to return. Omitted or 0 uses the default of 100. Negative values or values above 1000 return 400; they are not clamped.

Default: 100

Min: 0

Max: 1000

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.search.post({
    timeRange: {
        from: {
            relative: "15m",
        },
        to: {
            relative: "now",
        },
    },
    pagination: {
        limit: 50,
    },
});

Response Example

Show Response Example
{
  "data": [
    {
      "trace_id": "bef35030c4024f42fb88041fea062e97",
      "started": "2026-10-09T09:21:39.99Z",
      "service_name": "checkout-api",
      "duration_ns": 10000000,
      "status": "Ok",
      "span_count": 1,
      "span_names": [
        "checkout-api-root"
      ]
    }
  ],
  "pagination": {
    "has_more": false
  }
}

More Information

See /v2/insights/query/{region}/traces/search 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.