Skip to content
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

Add NodeReplacer for BinaryExpr where it is a VectorSelector + Literal #676

Merged
merged 3 commits into from
Sep 14, 2024

Conversation

jacksontj
Copy link
Owner

If the query is something like foo>1 prior to this patch we unwrap and send down to each downstream foo and then do the comparison (binaryExpr) in promxy. This is non-ideal as we are sending some data back that could have been dropped at the remote end.

Although this is a great performance optimization we will need to be careful when adding cases to this. For BinaryExprs to be sent to each servergroup in a valid way the query must be "local" to a given servergroup. For example; sum(foo)>1 would not be safe to send downstream as sum(foo) requires adding across a variety of servergroups to determine the correct value.

Fixes #673

VectorSelector/AggregateExpr

If the query is something like `foo>1` prior to this patch we unwrap and
send down to each downstream `foo` and then do the comparison
(binaryExpr) in promxy. This is non-ideal as we are sending some data
back that could have been dropped at the remote end.

Although this is a great performance optimization we will need to be
careful when adding cases to this. For BinaryExprs to be sent to
each servergroup in a `valid` way the query must be "local" to a given
servergroup. For example; `sum(foo)>1` would *not* be safe to send
downstream as `sum(foo)` requires adding across a variety of
servergroups to determine the correct value.

Fixes #673
This is a first-pass as we are starting to get more complex in what we
support here (especially with subquery).
@jacksontj jacksontj merged commit da7e730 into master Sep 14, 2024
1 check passed
@jacksontj jacksontj deleted the issue_673 branch September 14, 2024 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VectorSelector query criteria not send to backend prometheus
1 participant