Address review comments

Signed-off-by: Levi Harrison <git@leviharrison.dev>
This commit is contained in:
Levi Harrison 2021-09-26 15:45:25 -04:00
parent e27ac3e7e4
commit 2f896c98ff
4 changed files with 10 additions and 2 deletions

View File

@ -44,7 +44,7 @@ the result.
The following trigonometric binary operators, which work in radians, exist in Prometheus:
* `atan2` (https://pkg.go.dev/math#Atan2, _This is experimental_)
* `atan2` (based on https://pkg.go.dev/math#Atan2, _This is experimental_)
Trigonometric operators allow trigonometric functions to be executed on two vectors using
vector matching, which isn't available with normal functions. They act in the same manner

View File

@ -17,7 +17,6 @@
@precedence {
pow @right,
mul @left
atan2 @left,
add @left,
eql @left,
and @left,

View File

@ -840,3 +840,10 @@ sum:my_metric_name:rate5m
==>
MetricName(MetricIdentifier(Identifier))
# Testing Atan2 inherited precedence level
1 + foo atan2 bar
==>
PromQL(Expr(BinaryExpr(Expr(NumberLiteral),Add,BinModifiers,Expr(BinaryExpr(Expr(VectorSelector(MetricIdentifier(Identifier))),Atan2,BinModifiers,Expr(VectorSelector(MetricIdentifier(Identifier))))))))

View File

@ -14,6 +14,7 @@
import {
And,
Avg,
Atan2,
Bool,
Bottomk,
By,
@ -58,6 +59,7 @@ export const specializeIdentifier = (value, stack) => {
const contextualKeywordTokens = {
avg: Avg,
atan2: Atan2,
bottomk: Bottomk,
count: Count,
count_values: CountValues,