-
Notifications
You must be signed in to change notification settings - Fork 824
Querier: Support configuring optimizers and XFunctions #6873
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
base: master
Are you sure you want to change the base?
Querier: Support configuring optimizers and XFunctions #6873
Conversation
edea965
to
c160724
Compare
099bdbf
to
9052bee
Compare
Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
9052bee
to
895dd48
Compare
pkg/engine/config.go
Outdated
func (cfg *Config) RegisterFlags(f *flag.FlagSet) { | ||
f.BoolVar(&cfg.EnableThanosEngine, "querier.thanos-engine", false, "Experimental. Use Thanos promql engine https://github.com/thanos-io/promql-engine rather than the Prometheus promql engine.") | ||
f.BoolVar(&cfg.EnableXFunctions, "querier.enable-x-functions", false, "Enable xincrease, xdelta, xrate etc from Thanos engine.") | ||
f.StringVar(&cfg.Optimizers, "querier.optimizers", "default", "Logical plan optimizers. Multiple optimizers can be provided as a comma-separated list. Supported values: "+strings.Join(supportedOptimizers, ", ")) |
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.
Maybe we can accept a prefix so that the prefix can be either querier or ruler.
<prefix>.thanos-engine.enabled
<prefix>.thanos-engine.enable-x-functions
<prefix>.thanos-engine.optimizers
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.
Maybe we should also have a small doc talking about what are these optimizers and what they do. For now, can we at least mention in the flag description that, what optimizers are included in default
and what additional optimizers are included in all
? And they cannot be enabled together.
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.
For the second comment, I am planning to add a String()
function to the Optimizer
interface in thanos engine. This will make it easier to do.
require.Equal(t, 200, res.StatusCode) | ||
|
||
for xFunc := range parse.XFunctions { | ||
result, err := c.Query(fmt.Sprintf(`%s(series_1{job="test"}[1m])`, xFunc), series1Timestamp) |
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.
I am a bit surprised that this test could pass when querying query frontend. I don't see we register those functions there. Only in querier.
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.
Maybe because the middlewares are disabled by default.
bdea544
to
717b8cd
Compare
Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
717b8cd
to
4fcd0ec
Compare
What this PR does:
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]