Skip to content

feat(traceql): parse leading-dot, trailing-dot and exponent float literals - #1086

Open
44YHC wants to merge 2 commits into
feat/traceql-structural-opsfrom
feat/traceql-dot-float
Open

44YHC wants to merge 2 commits into
feat/traceql-structural-opsfrom
feat/traceql-dot-float

Conversation

@44YHC

@44YHC 44YHC commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #1034, from its review (".95 doesn't parse"). Based on feat/traceql-structural-ops; merges into it as a merge commit. #1087 is stacked on this one.

Summary

One lexer rule, matching Tempo v3.1.0: a Float token before Label_name replaces the old Float, covering leading-dot and trailing-dot floats and exponents. .95, -.5, 5., 1e3 and .5e2 parse. A digit right after . makes a number, so { .5xx = 1 } is a syntax error as in Tempo, while span.5xx and .foo.95 stay attributes.

Breaking changes

Queries that now fail

  • { .5xx = 1 } and other unscoped attribute names that start with a digit are syntax errors, as in Tempo. Write span.5xx, or quote the name with the literals PR (."5xx").
  • 5 . 5 (spaces around the dot) is a syntax error. It used to read as 5.5.

Upgrade notes

None. No setting, schema or plugin change.

Evidence

  • Parser tests pin every form above, accepted and rejected, against Tempo v3.1.0's behaviour. The 1 . 5 pins are rewritten as 1.5.
  • go test ./... passes. The full e2e suite and grid.traceql pass on the full stack tip, which includes this branch.

Merge Danger

Door: two-way. Parser only.

Blast Radius: TraceQL parsing. Queries Tempo accepts with these literals now parse; the two shapes above stop parsing.

Not in this PR, unchanged: arithmetic boundaries between an attribute and a float (.foo*.5, duration-.5), and small floats losing precision when rendered into SQL.

44YHC added 2 commits November 6, 2026 04:16
…erals

Lex numbers in one Float rule ahead of Label_name, so a digit right after
a dot makes a number and .95, -.5, 5., 1e3 and .5e2 parse as in Tempo
v3.1.0. Drop the Integer Dot Integer grammar form, so 5 . 5 is an error.

This branch has not been deployed

No deployments
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