- Running the same selection from the API, the CLI, and AI Studio.
- Combining several conditions in one expression instead of building a
filtersarray. - Handing a saved investigation to a teammate as a single line of text.
Overview
OQL is a pipeline language for selecting Traces and Logs. A query names the signal, then adds stages separated by|:
fetch comes first and is required. filter may repeat, and every filter is combined with and. A repeated sort or limit stage takes the last value. OQL compiles onto the same planner and field registry as the structured filters array, so a field or an operator that works there works in OQL too. There is no aggregation stage: calculated rows and time series come from the Telemetry API.
Quick start
Run a trace query over a time window. The API takes RFC 3339 timestamps only.search.data. Use the query examples below in the SDK’s oql field or in the request body. API time ranges use RFC 3339 timestamps.
Stages
Filter expressions
Two forms parse to the same filter. The symbol form covers equality and ordering:
The word form covers the operators that need their own syntax:
Lists take parentheses or square brackets and are comma separated. Values may be quoted with
" or ', which lets a value contain spaces; a quote inside a value needs the other quote character.
Which operators a field accepts depends on its type, not on the parser. A valid expression on the wrong field type is still rejected:
GET /v3/traces/fields for traces and GET /v3/logs/fields for logs.
Status filters use the success and error spelling; Trace status values maps them to the Telemetry API and Reporting values.
Rules per signal
Examples
Failing traces in the last dayOQL
OQL
OQL
OQL
OQL
filter stages only: sort and limit are rejected there. Field suggestions come from the workspace field registry.
Errors
A malformed query is rejected before the planner runs, so a bad request never returns partial rows.

