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

expose number of evaluated query plan options #6765

Merged
merged 10 commits into from
Feb 11, 2025
Merged

expose number of evaluated query plan options #6765

merged 10 commits into from
Feb 11, 2025

Conversation

dariuszkuc
Copy link
Member

Before we start generating a query plan, we need to first evaluate all possible ways (options) that given query can be resolved. This PR exposes number of options that were considered to generate a final query plan.

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Feb 11, 2025

✅ Docs preview has no changes

The preview was not built because there were no changes.

Build ID: d96c609c34403a9f43c23874

Copy link
Contributor

@dariuszkuc, please consider creating a changeset entry in /.changesets/. These instructions describe the process and tooling.

@@ -296,6 +296,8 @@ pub enum SingleFederationError {
InterfaceKeyMissingImplementationType { message: String },
#[error("@defer is not supported on subscriptions")]
DeferredSubscriptionUnsupported,
#[error("{message}")]
QueryPlanComplexityExceeded { message: String },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this!

@dariuszkuc dariuszkuc added the backport-1.x Backport this PR to 1.x label Feb 11, 2025
Copy link
Member

@lrlna lrlna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooooo can we have a metric in the router that tracks these as well? it can probably follow the example of max_evaluated_plans

@dariuszkuc
Copy link
Member Author

@lrlna new metric is added to the query_planner_service as apollo.router.query_planning.plan.evaluated_query_options

Copy link
Contributor

@sachindshinde sachindshinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits below, but after that it should be good to merge.

apollo-federation/src/query_plan/query_planner.rs Outdated Show resolved Hide resolved
apollo-router/src/query_planner/query_planner_service.rs Outdated Show resolved Hide resolved
apollo-router/src/query_planner/query_planner_service.rs Outdated Show resolved Hide resolved
dariuszkuc and others added 10 commits February 11, 2025 14:57
Before we start generating a query plan, we need to first evaluate all possible ways (options) that given query can be resolved. This PR exposes number of options that were considered to generate a final query plan.
Co-authored-by: Iryna Shestak <shestak.irina@gmail.com>
@dariuszkuc dariuszkuc merged commit 4fe75e8 into dev Feb 11, 2025
15 checks passed
@dariuszkuc dariuszkuc deleted the qp_options branch February 11, 2025 21:30
@dariuszkuc
Copy link
Member Author

@mergify backport 1.x

Copy link
Contributor

mergify bot commented Feb 11, 2025

backport 1.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Feb 11, 2025
Before we start generating a query plan, we need to first evaluate all possible ways (options) that given query can be resolved. This PR exposes number of options that were considered to generate a final query plan.

(cherry picked from commit 4fe75e8)
dariuszkuc added a commit that referenced this pull request Feb 11, 2025
Before we start generating a query plan, we need to first evaluate all possible ways (options) that given query can be resolved. This PR exposes number of options that were considered to generate a final query plan.

Co-authored-by: Dariusz Kuc <9501705+dariuszkuc@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-1.x Backport this PR to 1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants