Repository navigation
Conversation
Reuse the response path already held by the execution strategy so instrumentation can read it without initializing the lazy data fetching environment. Generated by Josh-Bot 9000
joshgord
force-pushed
the
field-fetch-instrumentation-path
branch
from
December 4, 2026 23:20
195b79b to
589bd27
Compare
joshgord
marked this pull request as ready for review
December 4, 2026 23:21
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At Netflix, we use
instrumentDataFetcherto attach local context at top-level fields so nested resolvers can read it. The hook runs for every field. Today it callsgetExecutionStepInfo()to identify top-level fields, which builds the lazyDataFetchingEnvironmenteven for nested fetchers that only need their source object.We’ll use
parameters.getPath().getLevel() == 1to identify top-level fields and return the original fetcher for nested fields. The execution strategy already has the response path, so a nested property fetcher can skip building the environment when no other hook needs it.The accessor exposes a value the execution strategy already stores, so a hook can make root/nested decisions without triggering the lazy environment. In Netflix's full instrumentation chain (this change plus the companion DGS guard), paired replays of the production-shaped query mix on the production JDK measured ~3.5% lower allocated bytes per completed response and lower CPU per response; with either half missing, the environment is still built and the savings vanish.
The companion DGS change skips the resolver tag lookup when timers are disabled, removing another eager read of the execution step. Netflix/dgs-framework#2388
Generated by Josh-Bot 9000