prometheus/promql
Mauro Stettler 7715fe3219
Add matchers to LabelValues() call (#8400)
* Accept matchers in querier LabelValues()

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* create matcher to only select metrics which have searched label

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* test case for merge querier with matchers

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* test LabelValues with matchers on head

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* add test for LabelValues on block

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* formatting fix

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Add comments

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* add missing lock release

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* remove unused parameter

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Benchmarks for LabelValues() methods on block/head

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Better comment

Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* update comment

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* minor refactor make code cleaner

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* better comments

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* fix expected errors in test

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Deleting parameter which can only be empty

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* fix comments

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* remove unnecessary lock

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* only lookup label value if label name was looked up

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Return error when there is one

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Call .Get() on decoder before checking errors

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* only lock head.symMtx when necessary

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* remove unnecessary delete()

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* re-use code instead of duplicating it

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Consistently return error from LabelValueFor()

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* move helper func from util.go to querier.go

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* Fix test expectation

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>

* ensure result de-duplication and sorting works

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

* return named error from LabelValueFor()

Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>

Co-authored-by: Julien Pivotto <roidelapluie@gmail.com>
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-02-09 23:08:35 +05:30
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
parser Add start() and end() pre-processors for @ modifier (#8425) 2021-02-09 21:33:16 +05:30
testdata '@ <timestamp>' modifier (#8121) 2021-01-20 16:27:39 +05:30
bench_test.go Add context to Appender interface 2020-07-24 19:40:51 +05:30
engine.go Add start() and end() pre-processors for @ modifier (#8425) 2021-02-09 21:33:16 +05:30
engine_test.go Add matchers to LabelValues() call (#8400) 2021-02-09 23:08:35 +05:30
functions.go '@ <timestamp>' modifier (#8121) 2021-01-20 16:27:39 +05:30
functions_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
fuzz.go Fuzz: limit input size (#7317) 2020-05-31 09:42:56 +02:00
promql_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
quantile.go Fix off-by-one error in funcHistogramQuantile / ensureMonotonic (#7393) 2020-06-15 11:32:10 +01:00
query_logger.go promql: Swap order of parseBrokenJSON. (#7718) 2020-08-02 09:48:57 +01:00
query_logger_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
test.go Add start() and end() pre-processors for @ modifier (#8425) 2021-02-09 21:33:16 +05:30
test_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
value.go Move away from testutil, refactor imports (#8087) 2020-10-22 11:00:08 +02:00