-
Notifications
You must be signed in to change notification settings - Fork 273
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
Fix APQ and introspection gauges #6012
Conversation
This comment has been minimized.
This comment has been minimized.
1354d96
to
7bf64b2
Compare
Similar to the query planner gauges, these must be initialized after telemetry has been activated. Fixes: * `apollo_router_cache_size` for `APQ` and `introspection` As a result of this change every query planner in the query planner pool will share the same cache storage for introspection queries. Otherwise many identical gauges are created, and they are not summed. It doesn't really make sense that each query planner should have a separate cache anyway. Another issue was noticed, and commented on. APQLayer uses deduplicating cache which is fallible. This is initialized after telemetry has been activated, so if it fails it is likely that telemetry will stop working. This is not fixable without a larger refactor to bring APQ init forward, which is out of scope for this PR. We'll tackle router lifecycle as a larger holistic refactor later.
7bf64b2
to
e6da583
Compare
planner: Arc<Planner<QueryPlanResult>>, | ||
capacity: NonZeroUsize, | ||
cache: CacheStorage<String, Response>, |
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 see why we now need to pass the cache as an argument, but I feel it points to something wrong in the activate
call. Instead of calling it directly everywhere, could the plugins register a closure to handles activation when they are created?
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 agree with the sentiment of this, but none of the query planner or APQ stuff are plugins, so they don't get to participate lifecycle. It's non-plugin code that needs to register a closure right now.
As a team we should discuss the lifecycle hooks and work towards refactoring both non-plugin and plugin code to use an agreed upon model.
As part of this we should also examine what we want in terms of hot reload functionality, as actually having any hot reload significantly complicates our codebase.
Similar to the query planner gauges, these must be initialized after telemetry has been activated.
Fixes:
apollo_router_cache_size
forAPQ
andintrospection
As a result of this change every query planner in the query planner pool will share the same cache storage for introspection queries. Otherwise many identical gauges are created, and they are not summed. It doesn't really make sense that each query planner should have a separate cache anyway.
Another issue was noticed, and commented on. APQLayer uses deduplicating cache which is fallible. This is initialized after telemetry has been activated, so if it fails it is likely that telemetry will stop working. This is not fixable without a larger refactor to bring APQ init forward, which is out of scope for this PR. We'll tackle router lifecycle as a larger holistic refactor later.
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩