VictoriaMetrics/app/vmselect/promql
Aliaksandr Valialkin bb7406e9c0
app/vmselect/promql: follow-up for dd0d2c77c8 and 6149adbe10
Use metricsql.IsLikelyInvalid() function for determining whether the given query is likely invalid,
e.g. there is high change the query is incorrectly written, so it will return unexpected results.

The query is invalid most of the time if it passes something other than series selector into rollup function.
For example:

- rate(sum(foo))
- rate(foo + bar)
- rate(foo > bar)

Improtant note: the query is considered valid if it misses the lookbehind window in square brackes inside rollup function,
e.g. rate(foo), since this is very convenient MetricsQL extention to PromQL, and this query returns the expected results
most of the time.

Other unsafe query types can be added in the future into metricsql.IsLikelyInvalid().

TODO: probably, the -search.disableImplicitConversion command-line flag must be set by default in the future releases of VictoriaMetrics.

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4338
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6180
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6450
2024-07-03 00:46:56 +02:00
..
active_queries.go app: consistently use atomic.* types instead of atomic.* functions 2024-02-24 03:06:14 +02:00
aggr_incremental_test.go app/vmselect/promql: fix TestIncrementalAggr test on systems less than 3 CPU cores 2023-03-20 20:37:44 -07:00
aggr_incremental.go app/vmselect/promql/aggr_incremental.go: eliminate unnecessary memory allocation in incrementalAggrFuncContext.updateTimeseries 2024-01-23 02:29:13 +02:00
aggr_test.go app/vmselect/promql: simplify the code after 388d020b7c 2024-01-16 22:35:51 +02:00
aggr.go all: fix golangci-lint(revive) warnings after 0c0ed61ce7 2024-04-03 03:00:45 +03:00
binary_op.go app/vmselect: use strings.EqualFold instead of strings.ToLower where appropriate 2024-05-12 10:21:24 +02:00
eval_test.go app: consistently use atomic.* types instead of atomic.* functions 2024-02-24 03:06:14 +02:00
eval.go app/vmselect: use strings.EqualFold instead of strings.ToLower where appropriate 2024-05-12 10:21:24 +02:00
exec_test.go app/vmselect/promql: follow-up for dd0d2c77c8 and 6149adbe10 2024-07-03 00:46:56 +02:00
exec.go app/vmselect/promql: follow-up for dd0d2c77c8 and 6149adbe10 2024-07-03 00:46:56 +02:00
memory_limiter_test.go app/vmselect: return back the logic for limits the amounts of memory occupied by concurrently executed queries if -search.maxMemoryPerQuery isn't set 2022-10-10 21:54:18 +03:00
memory_limiter.go app/vmselect: return back the logic for limits the amounts of memory occupied by concurrently executed queries if -search.maxMemoryPerQuery isn't set 2022-10-10 21:54:18 +03:00
parser.go all: add support for or filters in series selectors 2023-07-15 23:56:18 -07:00
rollup_result_cache_test.go all: fix golangci-lint(revive) warnings after 0c0ed61ce7 2024-04-03 03:00:45 +03:00
rollup_result_cache.go lib/slicesutil: add helper functions for setting slice length and extending its capacity 2024-05-12 11:33:49 +02:00
rollup_test.go app/vmselect: add sum_eq_over_time, sum_gt_over_time and sum_le_over_time functions to MetricsQL 2024-02-13 23:40:30 +02:00
rollup_timing_test.go app/vmselect: use consistent randomizer in tests 2023-01-23 19:27:40 -08:00
rollup.go all: fix golangci-lint(revive) warnings after 0c0ed61ce7 2024-04-03 03:00:45 +03:00
timeseries_test.go app/vmselect/promql: use unsafe.Slice instead of deprecated reflect.SliceHeader 2024-02-29 17:51:16 +02:00
timeseries.go lib/slicesutil: add helper functions for setting slice length and extending its capacity 2024-05-12 11:33:49 +02:00
transform_test.go app/vmselect/promql: follow-up for 79e1c6a6fc 2023-03-27 18:04:30 -07:00
transform.go app/vmselect/promql: add support for matching against multiple numeric constants via q == (c1,...,cN) and q != (c1,...,cN) syntax 2024-04-19 17:57:09 +02:00
tzdata.go all: cleanup: remove // +build ... lines, since they are no longer needed after Go1.17, and the minimum supported Go version for VictoriaMetrics source code is Go1.20 2023-11-13 19:15:42 +01:00