Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TraceQL: Support negative values on aggregates #2289

Merged
merged 3 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* [BUGFIX] Stop searching for virtual tags if there are any hits.
This prevents invalid values from showing up for intrinsics like `status` [#2219](https://github.com/grafana/tempo/pull/2152) (@joe-elliott)
* [BUGFIX] Correctly return unique spans when &&ing and ||ing spansets. [#2254](https://github.com/grafana/tempo/pull/2254) (@joe-elliott)
* [BUGFIX] Support negative values on aggregate filters like `count() > -1`. [#2289](https://github.com/grafana/tempo/pull/2289) (@joe-elliott)

## v2.0.1 / 2023-03-03

Expand Down
7 changes: 6 additions & 1 deletion pkg/traceql/expr.y
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ scalarExpression: // shares the same operators as scalarPipelineExpression. spli
| scalarExpression MOD scalarExpression { $$ = newScalarOperation(OpMod, $1, $3) }
| scalarExpression POW scalarExpression { $$ = newScalarOperation(OpPower, $1, $3) }
| aggregate { $$ = $1 }
| static { $$ = $1 }
| INTEGER { $$ = NewStaticInt($1) }
| FLOAT { $$ = NewStaticFloat($1) }
| DURATION { $$ = NewStaticDuration($1) }
| SUB INTEGER { $$ = NewStaticInt(-$2) }
| SUB FLOAT { $$ = NewStaticFloat(-$2) }
| SUB DURATION { $$ = NewStaticDuration(-$2) }
;

aggregate:
Expand Down
Loading