-
Notifications
You must be signed in to change notification settings - Fork 57
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
engine: allow to override opts at query time #501
engine: allow to override opts at query time #501
Conversation
fc6c3fe
to
52d860e
Compare
res.LookbackDelta = opts.LookbackDelta() | ||
} | ||
if opts.EnablePerStepStats() { | ||
res.EnablePerStepStats = opts.EnablePerStepStats() |
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.
This maybe should be &= but im not sure if original logic was a bug or not!
Signed-off-by: Michael Hoffmann <[email protected]>
52d860e
to
fc40cf4
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
Maybe we should first create our own interface, and an adapter for the Prometheus engine. It looks like we are struggling to add features because we are coupled to the Prometheus interface. |
Will do |
Signed-off-by: Michael Hoffmann <[email protected]>
c6b4621
to
50340b9
Compare
This PR allows to override engine settings at query time by providing a custom QueryOption struct that implements the promql.QueryOpts interface and can be provided at runtime.
This prepares eventually overriding more options through this to allow controlling more behavior at query time ( i.e. optimizers, fallback; etc).