mirror of
https://github.com/prometheus/prometheus
synced 2025-03-23 11:46:41 +00:00
Related to #12318 . Allow using a PromQL expression for setting the offset, provided that: the expression evaluates to a scalar the expression does not contain vector selector (no TSDB access) the expression does not call the info() function (no TSDB access) the time() function is only called on the top level of the expression, not inside a subquery We'll call such expression a time expression. During parsing we no longer set OriginalOffset field in sub-queries and vector selectors, instead we set a new OriginalOffsetExpr field to the time expression, even if the expression is a literal number. Before evaluating the overall PromQL expression, the engine shall evaluate the time expressions and set the OriginalOffset field in vector selectors and subqueries to the calculated value. This makes the change fairly non intrusive. Later we can change the code to start using the expression more directly. Note: this prohibits using time() function inside a sub-query as the evaluation time is not constant inside a sub-query. Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com> |
||
---|---|---|
.. | ||
fuzz-data | ||
parser | ||
promqltest | ||
bench_test.go | ||
engine_internal_test.go | ||
engine_test.go | ||
engine.go | ||
functions_internal_test.go | ||
functions_test.go | ||
functions.go | ||
fuzz_test.go | ||
fuzz.go | ||
histogram_stats_iterator_test.go | ||
histogram_stats_iterator.go | ||
info_test.go | ||
info.go | ||
promql_test.go | ||
quantile_test.go | ||
quantile.go | ||
query_logger_test.go | ||
query_logger.go | ||
value_test.go | ||
value.go |