-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
tsdb: expose hook to customize block querier #14114
base: main
Are you sure you want to change the base?
Conversation
e63bf05
to
d7f9de9
Compare
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.
Very cool 👍
tsdb/db.go
Outdated
// BlockQuerierFunc is a function to return storage.Querier from a BlockReader. | ||
BlockQuerierFunc BlockQuerierFunc | ||
|
||
// BlockQuerierFunc is a function to return storage.ChunkQuerier from a BlockReader. |
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.
// BlockQuerierFunc is a function to return storage.ChunkQuerier from a BlockReader. | |
// BlockChunkQuerierFunc is a function to return storage.ChunkQuerier from a BlockReader. |
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.
Thanks, updated!
tsdb/db.go
Outdated
blockQuerierFunc func(b BlockReader, mint, maxt int64) (storage.Querier, error) | ||
|
||
blockChunkQuerierFunc func(b BlockReader, mint, maxt int64) (storage.ChunkQuerier, error) |
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.
Why don't these use the types defined?
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. Updated the code.
Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
f2d55b8
to
1063814
Compare
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
Thank you @bboreham for the review. Is it ready to be merged or requires another approval? Thanks |
In TSDB, during query time, blocks are only included or pruned based on time range and the logic is controlled in
blockChunkQuerierForRange
anddb.Querier
function.We want to experiment with different strategies so that Querier can apply additional filtering logic in the hook based on
BlockReader
. See the unit test addedTestBlockQuerierAndBlockChunkQuerier
. The filtering can be based on metadata from the block.