Skip to main content
A filter is JSON. Every field that you set must hold. A filter with no field matches everything. There is no query language as text: a saved view or an alert keeps this JSON.

Span filter

All set fields must hold on one span.
object
Text in the span’s input or output. See Text.
object
Text in the span’s error message, by the rules of Text. text does not look there.
string
Exact value. The same holds for kind, model, userId, sessionId, name, service and environment.
string
The span has this tag.
boolean
true: the span failed (status is error, or error is set). false: it did not fail.
integer
Start time in ms: from <= startedAt.
integer
Start time in ms: startedAt < to.
boolean
default:"false"
Only spans with no parent.
object | array
Exact values at attribute paths: {"path": value} or [["path", value]]. A value is a string, a number or a boolean.
  • A dot is a step of the path. So {"user.plan": "pro"} matches {"user": {"plan": "pro"}} and also the flat OpenTelemetry key "user.plan".
  • Resource attributes are under resource: "resource.host.name".
object[]
Every filter in the list holds. Two conditions on one field: {"and": [{"tag": "a"}, {"tag": "b"}]}.
object[]
At least one filter in the list holds. An empty list matches nothing.
object
This filter does not hold. A span with no value for a field does not have that value: {"not": {"model": "x"}} also matches the spans with no model.
and, or and not hold filters of the same shape, next to the other fields. {"kind": "tool_call", "or": [{"name": "a"}, {"name": "b"}], "not": {"hasError": true}} is a tool call named a or b that did not fail. Depth limit: 32 levels.

Text

text and errorText take an object with exactly one of these fields. Upper and lower case are the same.
string
Every part between spaces, each in input or in output, in any order. Characters with no space between them are found together, in their order: e-mail is e next to mail, and user@example.com is that address. A run of Thai, Korean or Chinese characters is that run.
string
The words next to each other, in this order.
string
A piece inside a word, as you type it for SQL LIKE '%...%'. One piece is found anywhere in a word: und finds refund, funding and REFUNDED.
  • With a space or a sign, the first piece is the end of a word, the last piece is the start of a word, and the pieces between are whole words, all next to each other. fund pol finds refund policy.
  • One character of Thai or Korean finds the runs that have it.
string
Whole words, and the last one may go on. refund finds refunded, and refund pol finds refund policy.
  • It is not a byte-for-byte LIKE. Signs and spaces are not in the index, so a-b, a b and a,b are the same.
  • A word of 256 bytes or more stays in the stored text, but no text search finds it.
  • text does not search the error message: use errorText.
  • The cost of contains and prefix follows the number of different words in the store, not the amount of text. A piece of one or two letters matches most words, and is slow.
  • A text of several pieces whose pieces match more than 16,384 different words in one segment gets 400, with a message that says so. Make the first or the last piece longer.
  • A phrase of 4,096 positions or more gets 400. A position is a word, or a word too long to index (256 bytes or more) between two words.
  • A phrase with 64 or more words too long to index in a row, between two of its words, gets 400. 63 are searched.
  • phrase, contains and prefix are one phrase each. In words, each part between spaces is a phrase of its own, so words takes any number of words.

Trace filter

All set fields must hold on one trace.
string
Exact value.
string
The user of the trace: the user of its root span, or else of its earliest span that has one.
string
The session of the trace.
string
The name of the root span.
boolean
true: the trace has a failed span. false: it has none.
integer
The trace started at or after this time (ms). A trace starts when its earliest span starts.
integer
The trace started before this time (ms).
string
A span of the trace has this tag. The same holds for service and environment.
object
A range of a total of the trace: {"min": a, "max": b}, so a <= value <= b. Leave out an end for no end. min above max matches no trace. Cost is in nano-dollars: one dollar is {"costNanos": {"min": 1000000000}}.
object
A span filter that the root span meets. The root (rootSpanId) is the earliest span with no parent, or the earliest span when every span has a parent.
object[]
Span filters. For each entry, some span of the trace meets it. Different spans may meet different entries. rootOnly in an entry asks for some span with no parent; root asks for the one root.
object[]
Score filters. For each entry, some score of the trace (on the trace or on one of its spans) meets it.
object[]
Trace filters. and, or and not work as in the span filter. Traces that failed or cost a dollar, and have no tool call: {"or": [{"hasError": true}, {"costNanos": {"min": 1000000000}}], "not": {"anySpan": [{"kind": "tool_call"}]}}.
  • One index lookup each: traceId, userId, sessionId, name, hasError, from, to, tag, service, environment, root with only a name, and an anySpan entry with only kind, model, name, tag, service or environment. The same holds for kind with model, name or hasError: true, and for an or of such entries.
  • A range of a total and a not read one column of the trace summaries.
  • Any other anySpan or root, and every anyScore, first finds the matching spans or scores, then their traces.
  • and, or and not cost what their parts cost.

Score filter

All set fields must hold on one score.
string
required
The name of the score.
number
value >= min.
number
value <= max.
string
Exact value. The same holds for source, authorId and evalId.
integer
The time of the score (at), not of its trace: from <= at, in ms.
integer
at < to, in ms.

Filter spans

A guide with real filters and answers.

Find traces

The route that takes a trace filter.