Julius Volz
e313ffa8ab
Fix "instant selector vector" typo in error messages ( #8800 )
...
Signed-off-by: Julius Volz <julius.volz@gmail.com>
4 years ago
Callum Styan
289ba11b79
Add circular in-memory exemplars storage ( #6635 )
...
* Add circular in-memory exemplars storage
Signed-off-by: Callum Styan <callumstyan@gmail.com>
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Martin Disibio <mdisibio@gmail.com>
Co-authored-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Co-authored-by: Tom Wilkie <tom.wilkie@gmail.com>
Co-authored-by: Martin Disibio <mdisibio@gmail.com>
* Fix some comments, clean up exemplar metrics struct and exemplar tests.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
* Fix exemplar query api null vs empty array issue.
Signed-off-by: Callum Styan <callumstyan@gmail.com>
Co-authored-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Co-authored-by: Tom Wilkie <tom.wilkie@gmail.com>
Co-authored-by: Martin Disibio <mdisibio@gmail.com>
4 years ago
schou
3bafe17870
add negative offset to printer
...
Signed-off-by: schou <pschou@users.noreply.github.com>
4 years ago
schou
efbf3af05d
reduce addOffst to 2 parameters
...
Signed-off-by: schou <pschou@users.noreply.github.com>
4 years ago
schou
851acf86ee
rebuild generated_parser.y.go
...
Signed-off-by: schou <pschou@users.noreply.github.com>
4 years ago
schou
0c577c547b
add negative offset ability
...
Signed-off-by: schou <pschou@users.noreply.github.com>
4 years ago
pschou
aff3c702ab
promql: Add sgn, clamp and last_over_time functions ( #8457 )
...
* Add sgn, clamp and last_over_time functions
Signed-off-by: schou <pschou@users.noreply.github.com>
4 years ago
Danny Kopping
42a0e0acad
Prevent lexer from seeking to next rune after lexing escape sequence. ( #8517 )
...
* Prevent lexer from seeking to next rune after lexing escape sequence.
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
4 years ago
Ganesh Vernekar
86c71856e8
Add start() and end() pre-processors for @ modifier ( #8425 )
...
* Add start() and end() pre-processors for @ modifier
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix reviews
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix review comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Fix review comments
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
4 years ago
Ganesh Vernekar
9199fcb8d1
'@ <timestamp>' modifier ( #8121 )
...
This commit adds `@ <timestamp>` modifier as per this design doc: https://docs.google.com/document/d/1uSbD3T2beM-iX4-Hp7V074bzBRiRNlqUdcWP6JTDQSs/edit .
An example query:
```
rate(process_cpu_seconds_total[1m])
and
topk(7, rate(process_cpu_seconds_total[1h] @ 1234))
```
which ranks based on last 1h rate and w.r.t. unix timestamp 1234 but actually plots the 1m rate.
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
4 years ago
Julien Pivotto
34656bbf8e
PromQL parser: fastpath for non-empty matchers and metric name ( #8345 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Atibhi Agrawal
0dd6e0cb76
change string(model.metricnamelabel) to model.metricnamelabel ( #8289 )
...
Signed-off-by: aSquare14 <atibhi.a@gmail.com>
4 years ago
Brian Brazil
bef9d4e182
Don't include rendered expression in parse errors. ( #8177 )
...
For a sufficiently complex expression, having to render
thousands of nodes for every subquery type error can take
a while - so don't do that.
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
4 years ago
Julien Pivotto
6c56a1faaa
Testify: move to require ( #8122 )
...
* Testify: move to require
Moving testify to require to fail tests early in case of errors.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* More moves
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
1282d1b39c
Refactor test assertions ( #8110 )
...
* Refactor test assertions
This pull request gets rid of assert.True where possible to use
fine-grained assertions.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Julien Pivotto
4e5b1722b3
Move away from testutil, refactor imports ( #8087 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Harkishen Singh
fc8e769d71
Use ASSIGN when using = inside braces ( #7911 )
...
* Fix EQL when using = inside braces.
Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
* EQL => EQLC and ASSIGN => EQL
Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
* Aligned yacc code.
Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>
4 years ago
johncming
267dd17fe7
promql/parser: use pos instead of origin. ( #7853 )
...
Signed-off-by: johncming <johncming@yahoo.com>
4 years ago
Julien Pivotto
d867491364
Human-friendly durations in PromQL ( #7713 )
...
* Add support for user-friendly durations
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
johncming
31929b83d5
promql: use explicit type declare instead of string. ( #7716 )
...
Signed-off-by: johncming <johncming@yahoo.com>
4 years ago
Owen Diehl
00b7bdb1b6
parser.{Expr,Statement} publicly implementable ( #7639 )
...
* parser.{Expr,Statement} publicly implementable
Signed-off-by: Owen Diehl <ow.diehl@gmail.com>
4 years ago
Guangwen Feng
6b7ac2ac1b
Add unit test case to improve test coverage for matcher.go ( #7658 )
...
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
4 years ago
Guangwen Feng
b30654211c
Fix incorrect arguments order in TestExprString ( #7602 )
...
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
4 years ago
Tobias Guggenmos
1f73073d73
Make without a valid metric identifier ( #7533 )
...
Discussion see #7532 .
cc @juliusv
Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
4 years ago
Julien Pivotto
72425d4e3d
Add group() aggregator ( #7480 )
...
* Add group() aggregator
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
4 years ago
Guangwen Feng
9ab072b470
Fix golint issue caused by typo ( #7475 )
...
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
4 years ago
Julien Pivotto
7eedcc708e
promql/parser: Cleanup generatedParserResult accross reuse
...
Reusing the same generatedParserResult ends up in strange panics:
See #7131 and #7127 .
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Julien Pivotto
1f6f8e60ee
promql/parser: Cleanup generatedParserResult accross reuse
...
Reusing the same generatedParserResult ends up in strange panics:
See #7131 and #7127 .
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Ben Kochie
269e7c8091
Fix golint issues.
...
Signed-off-by: Ben Kochie <superq@gmail.com>
5 years ago
johncming
bdc45c2b9e
remove unused code. ( #7019 )
...
Signed-off-by: johncming <johncming@yahoo.com>
5 years ago
Tobias Guggenmos
012161d90d
PromQL: Fix lexer error handling ( #6958 )
...
* PromQL: Fix lexer error handling
This fixes bugs in the handling of lexer errors that are only noticeable for users of the language server and caused https://github.com/prometheus-community/promql-langserver/issues/104 .
Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
* Add test for error position ranges
Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
5 years ago
Julien Pivotto
5ddd1dcf0f
Fix panic when parsing varags ( #6940 )
...
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
5 years ago
Tobias Guggenmos
1dbd799354
PromQL: Fix regression tests ( #6935 )
...
This PR fixes the regression tests for the issue fixed in #6931 .
The reason for that is that all of the invalid queries that triggered the regression have become more or less valid syntax in #6933 (they might still fail typechecking).
Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
5 years ago
Brian Brazil
44ad28dd5e
PromQL: Allow more keywords as metric names ( #6933 )
...
* Allow more keywords as metric names
* Add documentation about forbidden keywords
Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
5 years ago
Brian Brazil
7164b58945
PromQL: Fix parser panic ( #6931 )
...
Signed-off-by: Tobias Guggenmos <tobias.guggenmos@uni-ulm.de>
5 years ago
LongKB
82f7ed208b
Remove some duplicated words ( #6882 )
...
Signed-off-by: Pham Duc Hanh <hanhpd@fujitsu.com>
5 years ago
Tobias Guggenmos
ec3df53f78
Add nolint comment
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
6c00f2ffcb
Comment fixes
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
1360f9ff12
Fix all build errors in promql package
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
9a1366775e
Store function implementations independently of their signatures
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
ff0ea1c1ac
Fix more identifiers
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
6b1b323558
Export sequenceValue
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
65f5b9827d
Rename package
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
98a9b7c90c
Remove engine specific types
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago
Tobias Guggenmos
e7c2716f55
Move files
...
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
5 years ago