prometheus/promql
Advait Bhatwadekar 5d401f1e1b Added query logging for prometheus. Issue #1315 (#5794)
* Added query logging for prometheus.
Options added:
1) active.queries.filepath: Filename where queries will be recorded
2) active.queries.filesize: Size of the file where queries will be recorded.

Functionality added:
All active queries are now logged in a file. If prometheus crashes unexpectedly, these queries are also printed out on stdout in the rerun.

Queries are written concurrently to an mmaped file, and removed once they are done. Their positions in the file are reused. They are written in json format. However, due to dynamic nature of application, the json has an extra comma after the last query, and is missing an ending ']'. There may also null bytes in the tail of file.

Signed-off-by: Advait Bhatwadekar <advait123@ymail.com>
2019-07-31 16:12:43 +01:00
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
testdata Fix scalar-vector comparisons (#5454) 2019-04-11 10:42:16 +01:00
ast.go *: enable all default linters (#5504) 2019-05-03 15:11:28 +02:00
bench_test.go Allow promql benchmarks to query more samples (#4770) 2018-10-22 18:02:22 +01:00
engine.go Added query logging for prometheus. Issue #1315 (#5794) 2019-07-31 16:12:43 +01:00
engine_test.go Add storage.Warnings to LabelValues and LabelNames (#5673) 2019-06-17 08:31:17 +01:00
functions.go refine error handling in prometheus (#5388) 2019-03-26 00:01:12 +01:00
functions_test.go WIP: keep track of samples per query, set a max # of samples (#4513) 2018-10-02 12:59:19 +01:00
fuzz.go textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
lex.go Expose lexer item types (#5358) 2019-03-14 20:53:55 +01:00
lex_test.go Expose lexer item types (#5358) 2019-03-14 20:53:55 +01:00
parse.go Fix staticcheck errors 2019-04-17 01:40:10 +02:00
parse_test.go *: enable all default linters (#5504) 2019-05-03 15:11:28 +02:00
printer.go Correctly handle {__name__="a"} (#5552) 2019-05-11 00:46:15 +01:00
printer_test.go Correctly handle {__name__="a"} (#5552) 2019-05-11 00:46:15 +01:00
promql_test.go Fix most golint warnings. 2015-08-26 12:44:46 +02:00
quantile.go In histogram_quantile merge buckets with equivalent le values (#5158) 2019-02-01 10:22:44 +00:00
query_logger.go Added query logging for prometheus. Issue #1315 (#5794) 2019-07-31 16:12:43 +01:00
query_logger_test.go Added query logging for prometheus. Issue #1315 (#5794) 2019-07-31 16:12:43 +01:00
test.go Added query logging for prometheus. Issue #1315 (#5794) 2019-07-31 16:12:43 +01:00
test_test.go Fix some spelling issues (#5361) 2019-03-14 14:38:54 +00:00
value.go refine error handling in prometheus (#5388) 2019-03-26 00:01:12 +01:00