From c3b0e614ba638b850d0bb7e7d2d7f635da0ce142 Mon Sep 17 00:00:00 2001 From: Clemens Sageder <77528379+Sageder@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:54:26 +0200 Subject: [PATCH] [PromQL] Added missing trigonometric functions (#3612) --- promql/PromQLLexer.g4 | 15 +++++++++++++++ promql/examples/function.txt | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/promql/PromQLLexer.g4 b/promql/PromQLLexer.g4 index 949c46e933..6affb25ac5 100644 --- a/promql/PromQLLexer.g4 +++ b/promql/PromQLLexer.g4 @@ -154,6 +154,21 @@ FUNCTION options { caseInsensitive=false; } | 'stddev_over_time' | 'stdvar_over_time' | 'last_over_time' + | 'acos' + | 'acosh' + | 'asin' + | 'asinh' + | 'atan' + | 'atanh' + | 'cos' + | 'cosh' + | 'sin' + | 'sinh' + | 'tan' + | 'tanh' + | 'deg' + | 'pi' + | 'rad' ; LEFT_BRACE: '{'; diff --git a/promql/examples/function.txt b/promql/examples/function.txt index 387e66e711..27b3f4ef8c 100644 --- a/promql/examples/function.txt +++ b/promql/examples/function.txt @@ -1 +1,2 @@ -day_of_month(timestamp(up{job="prometheus"})) \ No newline at end of file +day_of_month(timestamp(up{job="prometheus"})) +sin(rate(http_requests_total[5m]))