-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add support for label matchers in LabelNames and LabelValues call to store. #4107
Conversation
e988ef2
to
a8d7380
Compare
indexr *bucketIndexReader, | ||
chunkr *bucketChunkReader, | ||
matchers []*labels.Matcher, | ||
req *storepb.SeriesRequest, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of req
we now pass all used parameters explicitly.
|
||
s.mtx.RLock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that s.mtx.RLock()
is now only called after checking hints. Previously wrong hints would return error without unlocking this lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the great work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job! 👏 LGTM
The failing TestTargetsAPI_Fanout
is known to be flaky. Unrelated from this change.
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
…n use that. Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
5838ceb
to
84c4e5a
Compare
I've just rebased master. Let's see if CI passes now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving again. @yeya24 also approved and only the rebase has been done in the meanwhile.
@@ -1261,7 +1302,25 @@ func (s *BucketStore) LabelValues(ctx context.Context, req *storepb.LabelValuesR | |||
} | |||
} | |||
|
|||
// If we have series matchers, add <labelName> != "" matcher, to only select series that have given label name. | |||
if len(reqSeriesMatchers) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if reqSeriesMatchers
already contains this unequal matcher? @pstibrany @pracucci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End result will be correct, but there is an optimization we can do (preferably in blockSeries
to be more general).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense. Thank you.
Changes
This PR implements support for label matches in
LabelNames
andLabelValues
API calls to bucket store. It reuses existingblockSeries
implementation, but without fetching of chunks.Verification
Unit tests.
This is a partial fix for issue #3637