pydo.insights.post_traces_search()
Generated on 13 Nov 2026
from pydo version
v0.46.0
Usage
client.insights.post_traces_search(
region="nyc3",
body={
"time_range": {...},
"filter": {...},
"order_by": [...],
...,
},
)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
regionstring requiredThe datacenter region slug for the query.
time_rangeobject requiredAn inclusive query time window. Both bounds are required,
frommust not be afterto, and the window must not exceed 7 days (168h).Show child properties
fromobject requiredA single point in time. Set
absoluteorrelative; if both are set,absoluteis used.Show child properties
absolutestring optionalExample:
2026-10-09T00:00:00ZAn 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.
relativestring optionalExample:
15mA time relative to now. Use
nowfor the current time, a bare duration such as15mor24hto look back from now, or an offset such asnow-2hornow+30m. Supported units ares,m,h,d, andw; decimal amounts such as1.5hare allowed.
toobject requiredA single point in time. Set
absoluteorrelative; if both are set,absoluteis used.Show child properties
absolutestring optionalExample:
2026-10-09T00:00:00ZAn 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.
relativestring optionalExample:
15mA time relative to now. Use
nowfor the current time, a bare duration such as15mor24hto look back from now, or an offset such asnow-2hornow+30m. Supported units ares,m,h,d, andw; decimal amounts such as1.5hare allowed.
filterobject optionalA 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
conditionobject optionalA single field comparison in a traces filter expression.
Show child properties
fieldobject requiredA reference to a span field, used in filters and
order_by.Show child properties
namestring requiredExample:
service.nameThe 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, andservice_name(service.name). Any other name is looked up as a span attribute, falling back to a resource attribute. Withscopeset,nameis always treated as an attribute key. Attribute keys may contain only letters, digits, and.,_,-,/,:,@.
In tracesorder_by,namemust be a trace-level sort field instead; see theorder_byfield description.scopestring optionalRestricts the lookup to one attribute map and is matched case-insensitively.
FIELD_SCOPE_RESOURCEreads resource attributes and acceptsresourceorresource.attributesas aliases.FIELD_SCOPE_ATTRIBUTESreads span attributes and acceptsattribute,attributes, orspan.attributesas aliases. Omit to use the built-in column mapping described forname. Ignored in tracesorder_by.
operatorstring requiredvalueobject optionalA typed literal or list value for a traces filter condition. Exactly one kind is set per message.
Show child properties
string_valuestring optionalExample:
checkout-apinumber_valuenumber optionalExample:
500000000string_array_valueobject optionalnumber_array_valueobject optional
andobject optionalShow child properties
expressionsarray of objects requiredShow child properties
conditionobject optionalA single field comparison in a traces filter expression.
andobject optionalorobject optionalnotobject optionalA 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.
text_searchobject optionalA substring search across span names, service names, and status messages.
orobject optionalShow child properties
expressionsarray of objects requiredShow child properties
conditionobject optionalA single field comparison in a traces filter expression.
andobject optionalorobject optionalnotobject optionalA 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.
text_searchobject optionalA substring search across span names, service names, and status messages.
notobject optionalA 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
conditionobject optionalA single field comparison in a traces filter expression.
Show child properties
fieldobject requiredA reference to a span field, used in filters and
order_by.operatorstring requiredvalueobject optionalA typed literal or list value for a traces filter condition. Exactly one kind is set per message.
andobject optionalShow child properties
expressionsarray of objects required
orobject optionalShow child properties
expressionsarray of objects required
notobject optionalA 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
conditionobject optionalA single field comparison in a traces filter expression.
andobject optionalorobject optionalnotobject optionalA 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.
text_searchobject optionalA substring search across span names, service names, and status messages.
text_searchobject optionalA substring search across span names, service names, and status messages.
Show child properties
querystring requiredExample:
timeoutThe search string. Leading and trailing whitespace is trimmed, and the remaining string must not be empty.
text_searchobject optionalA substring search across span names, service names, and status messages.
Show child properties
querystring requiredExample:
timeoutThe search string. Leading and trailing whitespace is trimmed, and the remaining string must not be empty.
order_byarray of objects optionalSort clauses applied in order. Defaults to
starteddescending.Show child properties
fieldobject requiredA reference to a span field, used in filters and
order_by.Show child properties
namestring requiredExample:
service.nameThe 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, andservice_name(service.name). Any other name is looked up as a span attribute, falling back to a resource attribute. Withscopeset,nameis always treated as an attribute key. Attribute keys may contain only letters, digits, and.,_,-,/,:,@.
In tracesorder_by,namemust be a trace-level sort field instead; see theorder_byfield description.scopestring optionalRestricts the lookup to one attribute map and is matched case-insensitively.
FIELD_SCOPE_RESOURCEreads resource attributes and acceptsresourceorresource.attributesas aliases.FIELD_SCOPE_ATTRIBUTESreads span attributes and acceptsattribute,attributes, orspan.attributesas aliases. Omit to use the built-in column mapping described forname. Ignored in tracesorder_by.
directionstring optionalThe sort direction, matched case-insensitively. Omit to use the server default.
paginationobject optionalLimits the size of a traces search result set. There is no cursor; use
pagination.has_morein the response to tell whether more traces matched, and narrow the time range or filter to see them.Show child properties
limitinteger optionalExample:
50Maximum number of traces to return. Omitted or
0uses the default of 100. Negative values or values above 1000 return400; they are not clamped.
Request Sample
Response Example
More Information
See /v2/insights/query/{region}/traces/search in the API reference for additional detail on responses, headers, parameters, and more.