mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -08:00
LabelValues() with matchers should use cache
When cache was introduced, LabelValues() could never be called with "concurrent" flag so it didn't make sense to use the cached call through the Head. However, since the introduction of forced cache, we should use it, as even with concurrent=false the cache may be used. Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
This commit is contained in:
parent
320f0c9c4a
commit
664c125d87
|
@ -380,7 +380,7 @@ func inversePostingsForMatcher(ctx context.Context, ix IndexPostingsReader, m *l
|
|||
const maxExpandedPostingsFactor = 100 // Division factor for maximum number of matched series.
|
||||
|
||||
func labelValuesWithMatchers(ctx context.Context, r IndexReader, name string, matchers ...*labels.Matcher) ([]string, error) {
|
||||
p, err := PostingsForMatchers(ctx, r, matchers...)
|
||||
p, err := r.PostingsForMatchers(ctx, false, matchers...)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "fetching postings for matchers")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue