Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushdown labels values matchers API to store levels #4220

Merged
merged 1 commit into from
May 28, 2021

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented May 11, 2021

Signed-off-by: yeya24 yb532204897@gmail.com

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Fixes #3779.

Now the labelvalue matchers push down are implemented in the TSDB store, Prometheus store, and the bucket store, thanks to @Namanl2001 and @pstibrany. Now it is ready to replace the old series approach with the new implementation.

Also, this pr adds Prometheus release v2.26.0 to our circle CI test to ensure the compatibility and correctness of the new label values matchers for newer Prometheus versions. This is mentioned in #4020 (reply in thread).

Verification

@yeya24 yeya24 force-pushed the pushdown-lb-values branch 3 times, most recently from 2fc851b to df646bb Compare May 12, 2021 01:18
Signed-off-by: yeya24 <yb532204897@gmail.com>
Copy link
Member

@onprem onprem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

s := q.Select(false, nil, mset...)
sets = append(sets, s)
var callWarnings storage.Warnings
labelValuesSet := make(map[string]struct{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only question is why are you building a map[string]struct{} here instead of adding everything directly to vals:

			retrievedVals, callWarnings, err := q.LabelValues(name, matchers...)
			if err != nil {
				return nil, nil, &api.ApiError{Typ: api.ErrorExec, Err: err}
			}
			warnings = append(warnings, callWarnings...)
			vals = append(vals, retrievedVals...)

? 🤔 This should be more efficient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is to filter out duplicates.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, right! Thanks for the answer.

@GiedriusS GiedriusS merged commit 800a486 into thanos-io:main May 28, 2021
@yeya24 yeya24 deleted the pushdown-lb-values branch May 28, 2021 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Bucket LabelValues Call with matchers
3 participants