Skip to content

lib/traceql: wrap OR filters in parentheses - #320

Open
ZeXi0308 wants to merge 1 commit into
VictoriaMetrics:masterfrom
ZeXi0308:fix/traceql-or-parentheses
Open

ZeXi0308 wants to merge 1 commit into
VictoriaMetrics:masterfrom
ZeXi0308:fix/traceql-or-parentheses

Conversation

@ZeXi0308

Copy link
Copy Markdown

Fixes #319

{ status = error || duration > 5s } was translated to status_code:=2 or duration:>5000000000 and put after {resource_attr:service.name!=""} AND as is. The duration condition was then no longer limited to span streams and matched trace ID index rows as well, which gave an extra count in metrics queries and an empty trace ID in search.

An OR filter is now always rendered in parentheses. One existing expectation in TestParseQuery gets outer parentheses because of that.

`{ status = error || duration > 5s }` was translated to `status_code:=2 or duration:>5000000000`
and put after `{resource_attr:service.name!=""} AND ` as is. The `duration` condition was then
no longer limited to span streams and matched trace ID index rows as well, which gave an extra
count in metrics queries and an empty trace ID in search.

An OR filter is now always rendered in parentheses.

Fixes VictoriaMetrics#319

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Re-trigger cubic

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.

Tempo API: || in a TraceQL filter gives a wrong count, and search returns 400

1 participant