Skip to content

test(grid): TraceQL structural operators and pipeline grid suite - #23

Open
44YHC wants to merge 29 commits into
mainfrom
traceql-structural-ops
Open

44YHC wants to merge 29 commits into
mainfrom
traceql-structural-ops

Conversation

@44YHC

@44YHC 44YHC commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A TraceQL grid suite for metrico/gigapipe#1034. It covers structural operators, the pipeline and field expressions in search, metrics and autocomplete.

grid/traceql/
├── seed.js         # ten fixture shapes: chains, two roots, root-less, orphans, time-range edge, parent cycles, attribute matrix, …
├── cases.json      # cases as JSON ASTs, rendered to TraceQL
├── ast.js          # AST → query text
├── oracle.js       # reference evaluator: Tempo semantics over the seeded spans
├── cityhash.js     # ClickHouse cityHash64, for with(sample=…)
├── metrics.js, autocomplete.js, compare.js, client.js
└── oracle.test.js  # oracle self-check, runs without ClickHouse

Since the review of gigapipe#1034:

  • Rebased onto main, which now has the PromQL and LogQL grid suites.
  • Unresolved traces are skipped, not errors. The oracle applies gigapipe#1034's rule: an unresolved span acts as unreachable under >>, !>> and the one-hop operators, and <<, !<<, &>> and &<< return no spans from that trace. The deep-chain cases are re-derived under it and renamed (tr_chain9_deep_unreachable, tr_chain9_skip_shallow_operands, tr_chain9_not_nested, tr_empty_operands).
  • Two parent-cycle fixtures (a self-parented span and a two-span cycle), with every operator pinned on them.
  • The search response's metrics block is left out of the snapshots, since its job counts depend on portioning.

Evidence

  • The oracle self-check (jest grid/traceql/oracle.test.js) passes.
  • Against gigapipe#1034, two shards: the full e2e suite passes on ClickHouse 25.3, and grid.traceql on 24.9.
  • standard grid/traceql/: clean.

Merge Danger

Door: two-way. Tests only.

Blast Radius: CI. gigapipe master fails these cases until gigapipe#1034 merges. #24 merges into this branch first; then this merges into main, and gigapipe re-pins E2E_TESTS_REF to main before #1034's squash merge.

44YHC added 28 commits November 6, 2026 04:09
…elf-check

The seed writes the nine fixture shapes as named Zipkin spans in a past window. cases.json pairs each query with a JSON AST that the self-check prints back to the query; the oracle evaluates the AST to the expected traces, listed spans and matched counts, and the self-check holds it to hand-checked results. The e2e diffs /api/search against the oracle for plain selectors, spss, limit and the (from, to] boundary.
Search lists the three newest spans per spanset by default; matched still counts all ten.
The oracle relates spans to their parent and siblings over the whole seed,
skipping spans that cannot reach a root. Cases cover every one-hop operator
on every seed shape, chains, grouping, {} operands and the time-range
edges, with hand-checked results.
The oracle evaluates >>, << and their ! and & variants and models the
ancestry round limit of the e2e stack (R=3): a candidate trace with a
span 2^R or more parent links from a root or a missing parent fails the
search. 42 cases cover every transitive operator on every shape, the
depth-9 chain erroring and the depth-8 chain resolving, and the
children-first tree before and after its root lands.
A metrics oracle evaluates every metrics function over the oracle's
search result spans; the e2e diffs range, instant and compare() series
and checks that exemplars are result spans of their bucket.
Tags v2 and values v2 cases over selectors, structural operators, && and ||,
the unfiltered path, limit, a pushes-phased case and the round-limit error.
The oracle suggests the keys or values of its result spans.
The oracle evaluates select() per listed span, samples metrics result
spans with ClickHouse's cityHash64 by trace or span id, and thins
exemplars per series. Adds 8 search and 10 metrics cases with
hand-checked results.
… an error

The oracle follows the search's final rules: an unresolved span relates to
nothing, and <<, !<<, &>> and &<< return no span from a candidate trace
holding one. One-hop operators relate every span of a trace with a root and
no missing parent. The UNRESOLVED_ERROR handling and the cycle test go, the
eight unresolved cases get re-derived expectations, and the four that no
longer error lose "error" from their ids.
A self-parent span, and a 3-span cycle with a child below it in a trace with
a real root, seeded out of every other case's range. Cases pin the transitive
and one-hop operators and their ! and & variants on both.
chain8 stays in the results, so skipping chain9 is not vacuous.
…pshots

The snapshots pin the traces of a search response, not its metrics block.
@44YHC
44YHC force-pushed the traceql-structural-ops branch from f54fbc3 to c220c32 Compare November 9, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant