prometheus/promql
Filip Petkovski df6e388d53 parser: Allow parsing arbitrary functions
In Thanos we would like to start experimenting with custom functions that are
currently not part of the PromQL spec. We would do this by adding an implementation
for those functions in the Thanos engine: https://github.com/thanos-community/promql-engine and allow
users to decide which engine they want to use on a per-query basis.

Since we use the PromQL parser from Prometheus, injecting functions in the global `Functions` variable
would mean they also become available for the Prometheus engine. To avoid this side-effect, this commit
exposes a Parser interface in which the supported functions can be injected as an option. If not functions
are injected, the parser implementation will default to the functions defined in the global Functions variable.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2023-07-04 15:01:01 +00:00
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
parser parser: Allow parsing arbitrary functions 2023-07-04 15:01:01 +00:00
testdata Adds day_of_year function to PromQL 2022-05-20 14:08:34 +02:00
bench_test.go Add benchmark for query using timestamp() 2023-06-28 15:41:10 +10:00
engine.go Placate lint 2023-07-04 15:01:01 +00:00
engine_test.go Add test to confirm timestamp() behaves correctly when evaluating a range query. 2023-06-29 13:34:26 +10:00
functions.go Handle more arithmetic operators for native histograms (#12262) 2023-05-16 21:15:20 +02:00
functions_test.go Merge branch 'main' into linter/nilerr 2023-04-19 19:56:39 +02:00
fuzz.go textparse/scrape: Add option to scrape both classic and native histograms 2023-05-13 01:32:25 +02:00
fuzz_test.go error for invalid media type should not be completely swallowed (#10186) 2022-02-08 10:57:56 +01:00
promql_test.go add ctx to QueryEngine interface 2023-04-17 21:32:38 -07:00
quantile.go style: Replace else if cascades with switch 2023-04-19 17:22:31 +02:00
query_logger.go Close file descriptor in query logging (#11148) 2022-08-17 15:27:27 +05:30
query_logger_test.go refactor: move from io/ioutil to io and os packages (#10528) 2022-04-27 11:24:36 +02:00
test.go add ctx to QueryEngine interface 2023-04-17 21:32:38 -07:00
test_test.go promql: Separate Point into FPoint and HPoint 2023-04-13 19:25:16 +02:00
value.go promql: Separate Point into FPoint and HPoint 2023-04-13 19:25:16 +02:00
value_test.go Shortcut ContainsSameLabelset() (#11000) 2022-07-13 15:18:10 +05:30