-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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 in tsdb to allow customizing compactor #14113
Conversation
Signed-off-by: Ben Ye <benye@amazon.com>
Can you please take a look? @jesusvazquez Thanks |
@codesome plans to do the final review here (but @jesusvazquez you are more than welcome, too, of course). |
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. Nits on the comment.
tsdb/db.go
Outdated
@@ -189,8 +189,13 @@ type Options struct { | |||
|
|||
// EnableSharding enables query sharding support in TSDB. | |||
EnableSharding bool | |||
|
|||
// NewCompactorFunc is a function which initializes a TSDB compactor. |
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.
// NewCompactorFunc is a function which initializes a TSDB compactor. | |
// NewCompactorFunc is a function that returns a TSDB compactor. | |
// This overrides the default compactor if set. |
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 the comment.
Signed-off-by: Ben Ye <benye@amazon.com>
This PR tries to expose a hook in TSDB to allow downstream projects which uses TSDB as a library to customize their own compactor implementation. If no hook is provided, by default the leveled compactor is used. There is no change for Prometheus project itself.
Also added a test case to cover the usage of the hook.