Skip to content

Commit

Permalink
TraceQL: Support negative values on aggregates (#2289)
Browse files Browse the repository at this point in the history
* support negative values on aggregates

Signed-off-by: Joe Elliott <[email protected]>

* changelog

Signed-off-by: Joe Elliott <[email protected]>

* lint

Signed-off-by: Joe Elliott <[email protected]>

---------

Signed-off-by: Joe Elliott <[email protected]>
  • Loading branch information
joe-elliott authored Mar 31, 2023
1 parent 0c9a822 commit bfaac00
Show file tree
Hide file tree
Showing 5 changed files with 281 additions and 257 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,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

0 comments on commit bfaac00

Please sign in to comment.