Span filter
All set fields must hold on one span.Text in the span’s
input or output. See Text.Text in the span’s
error message, by the rules of Text. text does not look there.Exact value. The same holds for
kind, model, userId, sessionId, name, service and environment.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".
Every filter in the list holds. Two conditions on one field:
{"and": [{"tag": "a"}, {"tag": "b"}]}.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.
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.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 polfindsrefund policy. - One character of Thai or Korean finds the runs that have it.
Whole words, and the last one may go on.
refund finds refunded, and refund pol finds refund policy.What text search does not find
What text search does not find
- It is not a byte-for-byte
LIKE. Signs and spaces are not in the index, soa-b,a banda,bare the same. - A word of 256 bytes or more stays in the stored text, but no text search finds it.
textdoes not search theerrormessage: useerrorText.
Limits and cost of text search
Limits and cost of text search
- The cost of
containsandprefixfollows 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,containsandprefixare one phrase each. Inwords, each part between spaces is a phrase of its own, sowordstakes any number of words.
Trace filter
All set fields must hold on one trace.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}}.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.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.Score filters. For each entry, some score of the trace (on the trace or on one of its spans) meets it.
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"}]}}.What a trace filter costs
What a trace filter costs
- One index lookup each:
traceId,userId,sessionId,name,hasError,from,to,tag,service,environment,rootwith only aname, and ananySpanentry with onlykind,model,name,tag,serviceorenvironment. The same holds forkindwithmodel,nameorhasError: true, and for anorof such entries. - A range of a total and a
notread one column of the trace summaries. - Any other
anySpanorroot, and everyanyScore, first finds the matching spans or scores, then their traces. and,orandnotcost what their parts cost.
Score filter
All set fields must hold on one score.Filter spans
A guide with real filters and answers.
Find traces
The route that takes a trace filter.