POST /traces/query. A filter contains an ANDed list of conditions. Bound columns appear alongside other table columns in Setup → Fields; enable Searchable on any field callers should be able to filter. GET /filter/schema reports the enabled fields and their compatible operators.
This page covers the JSON wire format, the operator matrix by logical type, and the relationship between structured filters and the typed expressions used by role policies.
Filter body format
A filter object contains a top-levelfilter key with a conditions array. Every condition includes
name and op. Include map for map keys and omit it for table columns. The operator determines
whether the condition accepts value, values, or neither.
string
Map column containing the field, for example
SpanAttributes. Omit for a table column.string
required
The key name inside the map, for example
user.id or gen_ai.agent.name.string
required
The operator. Must be an operator compatible with the field’s logical type.
string | number | boolean
One comparison value. Used by
eq, ne, prefix, has, gt, gte, lt, and lte.array
Multiple values. Used by
in, not_in, has_any, has_all, and between. For between, pass exactly two numbers.exists and not_exists accept neither value nor values.
Operator matrix
The backend implements typed expressions for every logical type. The structured operators in the table below are the JSON wire form of the same typed expressions role policies use, so their spelling remains stable for API and cursor compatibility.String operators
eqandnematch exact string values.inandnot_inaccept a list of string values.prefixmatches the beginning of a string value.existsandnot_existstest whether the key is present regardless of value.
String array operators
haschecks for a single exact element.has_anychecks that at least one of the provided values is present.has_allchecks that all provided values are present.
Boolean operators
eqandnecompare againsttrueorfalse.
Number operators
eq,ne,gt,gte,lt,ltecompare numeric values.betweenaccepts a two-element range array[min, max].
Number fields are filter-only; role policies deliberately reject them. This design choice keeps policy expressions simple and auditable.
Related topics
- Filter schema endpoint — discover which fields and operators the current caller may use.
- Policies and roles — learn how typed expressions govern trace access.