Adds && <field> <op> <value> to the last spanset filter (returns a new builder).
Adds || <field> <op> <value> to the last spanset filter (returns a new builder).
Adds fields to | select(…) so search returns them on each matched span.
Joins other's spanset filters with a span-set operator: > (child), >> (descendant),
< (parent), << (ancestor), ~ (sibling), && / || (both / either). other's
select() is ignored.
Same as toString (so a builder serialises as its query text).
The TraceQL text.
StaticfieldRenders a field name: validates the scope or intrinsic and quotes odd attribute names.
StaticquoteQuotes and escapes a string as a TraceQL string literal.
StaticspanStarts a spanset filter. Each filters entry becomes <field> = <value>, joined with &&
in insertion order. TraceQL.span() alone matches every span ({}).
StaticvalueRenders a value for field (already rendered by TraceQL.field).
StaticwhereStarts a spanset filter with one condition: { <field> <op> <value> }.
Immutable TraceQL builder with escaping: span-set filters, structural operators and
select().Field names are validated (unknown scopes or intrinsics throw
ValidationError, because some Tempo endpoints silently ignore an invalid query); attribute names with anything outside[A-Za-z0-9_.]are quoted after the scope (span."grow weird-key"). String values are quoted and escaped (\,", newline, tab, CR), except duration literals on duration fields (200ms),ok|error|unsetonstatusand span kinds onkind. Numbers and booleans are written as literals;=~/!~need a string.