-
Notifications
You must be signed in to change notification settings - Fork 58
Insert project filters into OxQL query AST instead of raw string #7904
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
Conversation
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 looks great, thanks for doing it! I agree we should deduplicate the actual query-running method, but otherwise looks good. Thanks for the tests too.
d33d83f
to
a274aa1
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.
Looks great, thanks!
Closes #7532. Instead of manipulating the query as a string to add the filters at the end, pass the silo and project IDs to the oximeter client, which has the parsed query AST on hand, and let it do the manipulation.
In case of simple queries, we just insert the filters after the initial
get
operation. For "grouped" queries (like{ get a:b; get c:d | filter timestamp > @now() } | filter x > y
), the query is a tree, so we recurse down it and insert the filters in every leaf node, which is a simple query.