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.
🚀 Features
Support aliasing standard attributes for telemetry (Issue #5930)
The router now supports creating aliases for standard attributes for telemetry.
This fixes issues where standard attribute names collide with reserved attribute names. For example, the standard attribute name
entity.type
is a reserved attribute name for New Relic, so it won't work properly. Moreoverentity.type
is inconsistent with our other GraphQL attributes prefixed withgraphql.
The example configuration below renames
entity.type
tographql.type.name
:By @bnjjj in #5957
Enable router customizations to access demand control info (PR #5972)
Rhai scripts and coprocessors can now access demand control information via the context. For more information on Rhai constants to access demand control info, see available Rhai API constants.
By @tninesling in #5972
Support Redis connection pooling (PR #5942)
The router now supports Redis connection pooling for APQs, query planners and entity caches. This can improve performance when there is contention on Redis connections or latency in Redis calls.
By @Geal in #5942
🐛 Fixes
Remove unused fragments and input arguments when filtering operations (PR #5952)
This release fixes the authorization plugin's query filtering to remove unused fragments and input arguments if the related parts of the query are removed. Previously the plugin's query filtering generated validation errors when planning certain queries.
By @Geal in #5952
Hot-reloads will no longer interrupt certain gauges (PR #5996, PR #5999, PR #5999)
Previously when the router hot-reloaded a schema or a configuration file, the following gauges stopped working:
apollo.router.cache.storage.estimated_size
apollo_router_cache_size
apollo.router.v8.heap.used
apollo.router.v8.heap.total
apollo.router.query_planning.queued
This issue has been fixed in this release, and the gauges now continue to function after a router hot-reloads.
By @BrynCooke in #5996 and #5999 and #6012
Datadog sample propagation will respect previous sampling decisions (PR #6005)
PR #5788 introduced a regression where sampling was set on propagated headers regardless of the sampling decision in the router or upstream.
This PR reverts the code in question and adds a test to check that a non-sampled request doesn't result in sampling in the downstream subgraph service.
By @BrynCooke in #6005
Include request variables when scoring for demand control (PR #5995)
Demand control scoring in the router now accounts for variables in queries.
By @tninesling in #5995
📃 Configuration
Enable new and old schema introspection implementations by default (PR #6014)
Starting with this release, if schema introspection is enabled, the router runs both the old Javascript implementation and a new Rust implementation of its introspection logic by default.
The more performant Rust implementation will eventually replace the Javascript implementation. For now, both implementations are run by default so we can definitively assess the reliability and stability of the Rust implementation before removing the Javascript one.
You can still toggle between implementations using the
experimental_introspection_mode
configuration key. Its valid values:new
runs only Rust-based validationlegacy
runs only Javascript-based validationboth
(default) runs both in comparison and logs errors if differences ariseHaving
both
as the default causes no client-facing impact. It will record and output the metrics of its comparison as aapollo.router.operations.introspection.both
counter. (Note: if this counter in your metrics hasrust_error = true
oris_matched = false
, please open an issue with Apollo.)Note: schema introspection itself is disabled by default, so its implementation(s) are run only if it's enabled in your configuration:
By @SimonSapin in #6014
🧪 Experimental
Allow disabling persisted-queries-based query plan cache prewarm on schema reload
The router supports the new
persisted_queries.experimental_prewarm_query_plan_cache.on_reload
configuration option. It toggles whether a query plan cache that's prewarmed upon loading a new schema includes operations from persisted query lists. Its default istrue
. Setting itfalse
precludes operations from persisted query lists from being added to the prewarmed query plan cache.Some background about the development of this option:
In router v1.31.0, we started including operations from persisted query lists when the router prewarms the query plan cache when loading a new schema.
Then in router v1.49.0, we let you also prewarm the query plan cache from the persisted query list during router startup by setting
persisted_queries.experimental_prewarm_query_plan_cache
to true.In this release, we now allow you to disable the original feature so that the router can prewarm only recent operations from the query planning cache (and not operations from persisted query lists) when loading a new schema.
Note: the option added in v1.49.0 has been renamed from
persisted_queries.experimental_prewarm_query_plan_cache
topersisted_queries.experimental_prewarm_query_plan_cache.on_startup
. Existing configuration files will keep working as before, but with a warning that can be resolved by updating your config file:By @glasser in #5990