mirror of
https://github.com/prometheus/prometheus
synced 2025-04-21 14:46:28 +00:00
Address review comments
Signed-off-by: Levi Harrison <git@leviharrison.dev>
This commit is contained in:
parent
e27ac3e7e4
commit
2f896c98ff
@ -44,7 +44,7 @@ the result.
|
|||||||
|
|
||||||
The following trigonometric binary operators, which work in radians, exist in Prometheus:
|
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
|
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
|
vector matching, which isn't available with normal functions. They act in the same manner
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
@precedence {
|
@precedence {
|
||||||
pow @right,
|
pow @right,
|
||||||
mul @left
|
mul @left
|
||||||
atan2 @left,
|
|
||||||
add @left,
|
add @left,
|
||||||
eql @left,
|
eql @left,
|
||||||
and @left,
|
and @left,
|
||||||
|
@ -840,3 +840,10 @@ sum:my_metric_name:rate5m
|
|||||||
|
|
||||||
==>
|
==>
|
||||||
MetricName(MetricIdentifier(Identifier))
|
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))))))))
|
@ -14,6 +14,7 @@
|
|||||||
import {
|
import {
|
||||||
And,
|
And,
|
||||||
Avg,
|
Avg,
|
||||||
|
Atan2,
|
||||||
Bool,
|
Bool,
|
||||||
Bottomk,
|
Bottomk,
|
||||||
By,
|
By,
|
||||||
@ -58,6 +59,7 @@ export const specializeIdentifier = (value, stack) => {
|
|||||||
|
|
||||||
const contextualKeywordTokens = {
|
const contextualKeywordTokens = {
|
||||||
avg: Avg,
|
avg: Avg,
|
||||||
|
atan2: Atan2,
|
||||||
bottomk: Bottomk,
|
bottomk: Bottomk,
|
||||||
count: Count,
|
count: Count,
|
||||||
count_values: CountValues,
|
count_values: CountValues,
|
||||||
|
Loading…
Reference in New Issue
Block a user