You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed#86
Closed
renovate[bot] wants to merge 1 commit intomainapollographql/federation-jvm-spring-example:mainfrom
renovate/major-apollo-graphql-packagesapollographql/federation-jvm-spring-example:renovate/major-apollo-graphql-packagesCopy head branch name to clipboard
renovate[bot] wants to merge 1 commit intomainapollographql/federation-jvm-spring-example:mainfrom
renovate/major-apollo-graphql-packagesapollographql/federation-jvm-spring-example:renovate/major-apollo-graphql-packagesCopy head branch name to clipboard
Configuration can now specify different Cross-Origin Resource Sharing (CORS) rules for different origins using the cors.policies key. See the CORS documentation for details.
cors:
policies:
### The default CORS options work for Studio.
- origins: ["https://studio.apollographql.com"]### Specific config for trusted origins
- match_origins: ["^https://(dev|staging|www)?\\.my-app\\.(com|fr|tn)$"]allow_credentials: trueallow_headers: ["content-type", "authorization", "x-web-version"]### Catch-all for untrusted origins
- origins: ["*"]allow_credentials: falseallow_headers: ["content-type"]
apollo_router_jemalloc_metadata: Total number of bytes dedicated to metadata, which comprise base allocations used for bootstrap-sensitive allocator metadata structures and internal allocations.
apollo_router_jemalloc_resident: Maximum number of bytes in physically resident data pages mapped by the allocator, comprising all pages dedicated to allocator metadata, pages backing active allocations, and unused dirty pages.
apollo_router_jemalloc_retained: Total number of bytes in virtual memory mappings that were retained rather than being returned to the operating system via e.g. munmap(2) or similar.
Coprocessor: improve handling of invalid GraphQL responses with conditional validation (PR #7731)
The router was creating invalid GraphQL responses internally, especially when subscriptions terminate. When a coprocessor is configured, it validates all responses for correctness, causing errors to be logged when the router generates invalid internal responses. This affects the reliability of subscription workflows with coprocessors.
Fix handling of invalid GraphQL responses returned from coprocessors, particularly when used with subscriptions. Added conditional response validation and improved testing to ensure correctness. Added the response_validation configuration option at the coprocessor level to enable the response validation (by default it's enabled).
Fix deduplicated subscriptions hanging when one subscription closes (PR #7879)
Fixes a regression introduced in v1.50.0. When multiple client subscriptions are deduped onto a single subgraph subscription in WebSocket passthrough mode, and the first client subscription closes, the Router would close the subgraph subscription. The other deduplicated subscriptions would then silently stop receiving events.
Now outgoing subscriptions to subgraphs are kept open as long as any client subscription uses them.
Fix several hot reload issues with subscriptions (PR #7746)
When a hot reload is triggered by a configuration change, the router attempted to apply updated configuration to open subscriptions. This could cause excessive logging.
When a hot reload was triggered by a schema change, the router closed subscriptions with a SUBSCRIPTION_SCHEMA_RELOAD error. This happened before the new schema was fully active and warmed up, so clients could reconnect to the old schema, which should not happen.
To fix these issues, a configuration and a schema change now have the same behavior. The router waits for the new configuration and schema to be active, and then closes all subscriptions with a SUBSCRIPTION_SCHEMA_RELOAD/SUBSCRIPTION_CONFIG_RELOAD error, so clients can reconnect.
Fix error when removing non-UTF-8 headers with Rhai plugin (PR #7801)
When trying to remove non-UTF-8 headers from a Rhai plugin, users were faced with an unhelpful error. Now, non-UTF-8 values will be lossy converted to UTF-8 when accessed from Rhai. This change affects get, get_all, and remove operations.
Query planning errors with progressive override on interface implementations (PR #7929)
The router now correctly generates query plans when using progressive override (@override with labels) on types that implement interfaces within the same subgraph. Previously, the Rust query planner would fail to generate plans for these scenarios with the error "Was not able to find any options for {}: This shouldn't have happened.", while the JavaScript planner handled them correctly.
This fix resolves planning failures when your schema uses:
Interface implementations local to a subgraph
Progressive override directives on both the implementing type and its fields
Queries that traverse through the overridden interface implementations
The router will now successfully plan and execute queries that previously resulted in query planning errors.
Fix startup hang with an empty Persisted Queries list (PR #7831)
When the Persisted Queries feature is enabled, the router no longer hangs during startup when using a GraphOS account with no Persisted Queries manifest.
When a subgraph returns an unexpected response (ie not a body with at least one of errors or data), the errors surfaced by the router include an @ in the path which indicates an error applied to all elements in the array. This is not a behavior defined in the GraphQL spec and is not easily parsed.
This fix expands the @ symbol to reflect all paths that the error applies to.
Example
Consider a federated graph with two subgraphs, products and inventory, and a topProducts query which fetches a list of products from products and then fetches an inventory status for each product.
Prior to this change, if the inventory subgraph returns a malformed response, the router response would look like:
{
"data": {"topProducts": [{"name": "Table", "inStock": null}, {"name": "Chair", "inStock": null}]},
"errors": [
{
"message": "service 'inventory' response was malformed: graphql response without data must contain at least one error",
"path": ["topProducts", "@​"],
"extensions": {"service": "inventory", "reason": "graphql response without data must contain at least one error", "code": "SUBREQUEST_MALFORMED_RESPONSE"}
}
]
}
With this change, the response will look like:
{
"data": {"topProducts": [{"name": "Table", "inStock": null}, {"name": "Chair", "inStock": null}]},
"errors": [
{
"message": "service 'inventory' response was malformed: graphql response without data must contain at least one error",
"path": ["topProducts", 0],
"extensions": {"service": "inventory", "reason": "graphql response without data must contain at least one error", "code": "SUBREQUEST_MALFORMED_RESPONSE"}
},
{
"message": "service 'inventory' response was malformed: graphql response without data must contain at least one error",
"path": ["topProducts", 1],
"extensions": {"service": "inventory", "reason": "graphql response without data must contain at least one error", "code": "SUBREQUEST_MALFORMED_RESPONSE"}
}
]
}
The above examples reflect the behavior with include_subgraph_errors = true; if include_subgraph_errors is false:
Remove use of APOLLO_TELEMETRY_DISABLED from the fleet detector plugin (PR #7907)
The APOLLO_TELEMETRY_DISABLED environment variable only disables anonymous telemetry, it was never meant for disabling identifiable telemetry. This includes metrics from the fleet detection plugin.
The router now supports JWT audience (aud) validation. This allows the router to ensure that the JWT is intended
for the specific audience it is being used with, enhancing security by preventing token misuse across different audiences.
The following sample configuration will validate the JWT's aud claim against the specified audiences and ensure a match with either https://my.api or https://my.other.api. If the aud claim does not match either of those configured audiences, the router will reject the request.
authentication:
router:
jwt:
jwks: # This key is required.
- url: https://dev-zzp5enui.us.auth0.com/.well-known/jwks.jsonissuers: # optional list of issuers
- https://issuer.one
- https://issuer.twoaudiences: # optional list of audiences
- https://my.api
- https://my.other.apipoll_interval: <optional poll interval>headers: # optional list of static headers added to the HTTP request to the JWKS URL
- name: User-Agentvalue: router### These keys are optional. Default values are shown.header_name: Authorizationheader_value_prefix: Beareron_error: Error### array of alternative token sourcessources:
- type: headername: X-Authorizationvalue_prefix: Bearer
- type: cookiename: authz
Prioritize existing requests over query parsing and planning during "warm up" (PR #7223)
The router warms up its query planning cache during a hot reload. This change decreases the priority
of warm up tasks in the compute job queue to reduce the impact of warmup on serving requests.
This change adds new values to the job.type dimension of the following metrics:
apollo.router.compute_jobs.duration - A histogram of time spent in the compute pipeline by the job, including the queue and query planning.
Persisted queries: include operation name in PERSISTED_QUERY_NOT_IN_LIST error for debuggability (PR #7768)
When persisted query safelisting is enabled and a request has an unknown PQ ID, the GraphQL error now has the extension field operation_name containing the GraphQL operation name (if provided explicitly in the request). Note that this only applies to the PERSISTED_QUERY_NOT_IN_LIST error returned when manifest-based PQs are enabled, APQs are disabled, and the request contains an operation ID that is not in the list.
Introduce cooperative cancellation for query planning
The cooperative cancellation feature allows the router to gracefully handle query planning timeouts and cancellations, improving resource utilization.
The mode can be set to measure or enforce. We recommend starting with measure. In measure mode, the router will measure the time taken for query planning and emit metrics accordingly. In enforce mode, the router will cancel query planning operations that exceed the specified timeout.
To observe this behavior, the router telemetry has been updated:
Add an outcome attribute to the apollo.router.query_planning.plan.duration metric
Add an outcome attribute to the query_planning span
Below is a sample configuration to configure cooperative cancellation in measure mode:
Align on_graphql_error selector with subgraph_on_graphql_error (PR #7676)
The on_graphql_error selector will now return true or false, in alignment with the subgraph_on_graphql_error selector. Previously, the selector would return true or None.
Return valid GraphQL response when performing a websocket handshake (PR #7680)
PR #7141 added checks on GraphQL responses returned from coprocessors to ensure compliance with GraphQL specifications. This surfaced an issue where subscription responses over websockets could omit the required data field during the handshake, resulting in invalid GraphQL response payloads. All websocket subscription responses will now return a valid GraphQL response when doing the websocket handshake.
Support exporting resources on all Prometheus metrics (PR #7394)
By default, the Prometheus metrics exporter will only export resources as target_info metrics, not inline on every metric. Now, you can add resources to every metric by setting resource_selector to all (default is none).
telemetry:
exporters:
metrics:
common:
resource:
"test-resource": "test"prometheus:
enabled: trueresource_selector: all # This will add resources on every metrics
Note: this change only affects Prometheus, not OTLP.
Forbid unknown @link directives for supergraph schemas where purpose is EXECUTION or SECURITY
The legacy JavaScript query planner forbid any usage of unknown @link specs in supergraph schemas with either EXECUTION or SECURITY value set for the for argument (aka, the spec's "purpose"). This behavior had not been ported to the native query planner previously. This PR implements the expected behavior in the native query planner.
The query planner was adding an inline spread (...) conditioned on the Query type in deferred subgraph fetch queries. Such a query would be invalid in the subgraph when the subgraph schema renamed the root query type to somethhing other than Query. The fix removes the root type condition from all subgraph queries, so that they stay valid even when root types are renamed.
Preserve content-type for file uploads when Rhai scripts are in use (PR #7559)
If a Rhai script was invoked during file upload processing, then the "Content-Type" of the request was not preserved correctly. This would cause a file upload to fail.
The error message would be something like:
"message": "invalid multipart request: Content-Type is not multipart/form-data",
We made substantial updates to OpenTelemetry in router 2.0, but didn't catch that OpenTelemetry changed how it processed "endpoints" (destinations for metrics and traces) until now.
With the undetected change, the router wasn't setting the path correctly, resulting in failure to export metrics over HTTP when using the "default" endpoint. Neither metrics via gRPC nor traces were impacted.
We have fixed our interactions with the dependency and improved our testing to make sure this does not occur again. Additionally, the router now supports setting standard OpenTelemetry environment variables for endpoints.
There is still a known problem when using environment variables to configure endpoints for the HTTP protocol when transmitting to an un-encrypted endpoint (i.e., TLS not configured). This affects the following environment variables:
OTEL_EXPORTER_OTLP_ENDPOINT
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
When these environment variables are set to insecure hosts, messages will appear in the logs indicating an error, but the metrics and traces will still be sent correctly:
The Apollo Runtime Container is now included in our documentation for deployment options. It also includes instructions for running Apollo Router with the Apollo MCP Server.
Fix incorrect reference to apollo.router.schema.load.duration (PR #7582)
The in-memory cache documentation was referencing an incorrect metric to track schema load times. Previously it was referred to as apollo.router.schema.loading.time, whereas the metric being emitted by the router since v2.0.0 is actually apollo.router.schema.load.duration. This is now fixed.
Connectors improvements: Router 2.3.0 supports Connect spec v0.2, including batch requests, error customization, and direct access to HTTP headers. To use these features: upgrade your Router to 2.3, update your version of Federation to 2.11, and update the @link directives in your subgraphs to https://specs.apollo.dev/connect/v0.2.
Log whether safe-listing enforcement was skipped (Issue #7509)
When logging unknown operations encountered during safe-listing, include information about whether enforcement was skipped. This will help distinguish between truly problematic external operations (where enforcement_skipped is false) and internal operations that are intentionally allowed to bypass safelisting (where enforcement_skipped is true).
The Router now supports a response_body selector which provides access to the response body in telemetry configurations. This enables more detailed monitoring and logging of response data in the Router.
Support non-JSON and JSON-like content types for connectors (PR #7380)
Connectors now inspect the content-type header of responses to determine how they should treat the response. This allows more flexibility as prior to this change, all responses were treated as JSON which would lead to errors on non-json responses.
The behavior is as follows:
If content-type ends with /json (like application/json) OR +json (like application/vnd.foo+json): content is parsed as JSON.
If content-type is text/plain: content will be treated as a UTF-8 string. Content can be accessed in selection mapping via $ variable.
If content-type is any other value: content will be treated as a JSON null.
If no content-type header is provided: content is assumed to be JSON and therefore parsed as JSON.
If deserialization fails, an error message of Response deserialization failed with a error code of CONNECTOR_DESERIALIZE will be returned:
Include message and path for certain errors in Apollo telemetry (PR #7378)
For errors pertaining to connectors and demand control features, Apollo telemetry will now include the original error message and path as part of the traces sent to GraphOS.
Support ignoring specific headers during subscriptions deduplication (PR #7070)
The Router now supports ignoring specific headers when deduplicating requests to subgraphs which provide subscription events. Previously, any differing headers which didn't actually affect the subscription response (e.g., user-agent) would prevent or limit the potential of deduplication.
The introduction of the ignored_headers option allows you to specify headers to ignore during deduplication, enabling you to benefit from subscription deduplication even when requests include headers with unique or varying values that don't affect the subscription's event data.
Configuration example:
subscription:
enabled: truededuplication:
enabled: true # optional, default: trueignored_headers: # (optional) List of ignored headers when deduplicating subscriptions
- x-transaction-id
- custom-header-name
Support disabling the health check endpoint (PR #7519)
During the development of Router 2.0, the health check endpoint support was converted to be a plugin. Unfortunately, the support for disabling the health check endpoint was lost during the conversion.
This is now fixed and a new unit test ensures that disabling the health check does not result in the creation of a health check endpoint.
Propagate client name and version modifications through telemetry (PR #7369)
The Router accepts modifications to the client name and version (apollo::telemetry::client_name and apollo::telemetry::client_version), but those modifications were not propagated through the telemetry layers to update spans and traces.
After this change, the modifications from plugins on the router service are propagated through the telemetry layers.
Spans should only include path in http.route (PR #7390)
Per the OpenTelemetry spec, the http.route should only include "the matched route, that is, the path template used in the format used by the respective server framework."
Prior to this change, the Router sends the full URI in http.route, which can be high cardinality (ie /graphql?operation=one_of_many_values). The Router will now only include the path (/graphql).
Prefer headers propagated with Router YAML config over headers from Connector directives (PR #7499)
When configuring the same header name in both @connect(http: { headers: }) (or @source(http: { headers: })) in SDL and propagate in Router YAML configuration, the request had both headers, even if the value is the same. After this change, Router YAML configuration always wins.
Fixed native query planner regression not forbidding unknown spec links
The legacy JavaScript query planner forbids any usage of unknown @link specs in supergraph schemas with either EXECUTION or SECURITY value set for the for argument (aka, the spec's "purpose"). This behavior had not been ported to the native query planner previously. This PR implements the expected behavior in the native query planner.
(Query Planner) Fix invalid type condition in @defer fetch
The query planner could add an inline spread conditioned on the Query type in deferred subgraph fetch queries. Such a query would be invalid in the subgraph when the subgraph schema renamed the root query type. This fix removes the root type condition from all subgraph queries, so that they stay valid even when root types were renamed.
Add timeouts and connection health checks to Redis connections (Issue #6855)
The Router's internal Redis configuration has been improved to increase client resiliency under various failure modes (TCP failures and timeouts, unresponsive sockets, Redis server failures, etc.). It also adds heartbeats (a PING every 10 seconds) to the Redis clients.
Add example Rhai script for returning Demand Control metrics as response headers (PR #7564)
A new section has been added to the demand control documentation to demonstrate how to use Rhai scripts to expose cost estimation data in response headers. This allows clients to see the estimated cost, actual cost, and other demand control metrics directly in HTTP responses, which is useful for debugging and client-side optimization.
Redis connection leak on schema changes (PR #7319)
The router performs a 'hot reload' whenever it detects a schema update. During this reload, it effectively instantiates a new internal router, warms it up (optional), redirects all traffic to this new router, and drops the old internal router.
This change fixes a bug in that "drop" process where the Redis connections are never told to terminate, even though the Redis client pool is dropped. This leads to an ever-increasing number of inactive Redis connections as each new schema comes in and goes out of service, which eats up memory.
The solution adds a new up-down counter metric, apollo.router.cache.redis.connections, to track the number of open Redis connections. This metric includes a kind label to discriminate between different Redis connection pools, which mirrors the kind label on other cache metrics (ie apollo.router.cache.hit.time).
Propagate client name and version modifications through telemetry (PR #7369)
The router accepts modifications to the client name and version (apollo::telemetry::client_name and apollo::telemetry::client_version), but those modifications are not currently propagated through the telemetry layers to update spans and traces.
This PR moves where the client name and version are bound to the span, so that the modifications from plugins on the router service are propagated.
Avoid unnecessary cloning in the deduplication plugin (PR #7347)
The deduplication plugin always cloned responses, even if there were not multiple simultaneous requests that would benefit from the cloned response.
We now check to see if deduplication will provide a benefit before we clone the subgraph response.
There was also an undiagnosed race condition which meant that a notification could be missed. This would have resulted in additional work being performed as the missed notification would have led to another subgraph request.
Spans should only include path in http.route (PR #7390)
Per the OpenTelemetry spec, the http.route should only include "the matched route, that is, the path template used in the format used by the respective server framework."
The router currently sends the full URI in http.route, which can be high cardinality (ie /graphql?operation=one_of_many_values). After this change, the router will only include the path (/graphql).
Decrease log level for JWT authentication failure (PR #7396)
A recent change inadvertently increased the log level of JWT authentication failures from info to error. This reverts that change returning it to the previous behavior.
Avoid fractional decimals when generating apollo.router.operations.batching.size metrics for GraphQL request batch sizes (PR #7306)
Corrects the calculation of the apollo.router.operations.batching.size metric to reflect accurate batch sizes rather than occasionally returning fractional numbers.
Linux: Compatibility with glibc 2.28 or newer (PR #7355)
The default build images provided in our CI environment have a relatively modern version of glibc (2.35). This means that on some distributions, notably those based around RedHat, it wasn't possible to use our binaries since the version of glibc was older than 2.35.
We now maintain a build image which is based on a distribution with glibc 2.28. This is old enough that recent releases of either of the main Linux distribution families (Debian and RedHat) can make use of our binary releases.
Add support for connector header propagation via YAML config (PR #7152)
Added support for connector header propagation via YAML config. All of the existing header propagation in the Router now works for connectors by using headers.connector.all to apply rules to all connectors or headers.connector.sources.* to apply rules to specific sources.
Note that if one of these rules conflicts with a header set in your schema, either in @connect or @source, the value in your Router config will
take priority and be treated as an override.
headers:
connector:
all: # configuration for all connectors across all subgraphsrequest:
- insert:
name: "x-inserted-header"value: "hello world!"
- propagate:
named: "x-client-header"sources:
connector-graph.random_person_api:
request:
- insert:
name: "x-inserted-header"value: "hello world!"
- propagate:
named: "x-client-header"
Enable configuration auto-migration for minor version bumps (PR #7162)
To facilitate configuration evolution within major versions of the router's lifecycles (e.g., within 2.x.x versions), YAML configuration migrations are applied automatically. To avoid configuration drift and facilitate maintenance, when upgrading to a new major version the migrations from the previous major (e.g., 1.x.x) will not be applied automatically. These will need to be applied with router config upgrade prior to the upgrade. To facilitate major version upgrades, we recommend regularly applying the configuration changes using router config upgrade and committing those to your version control system.
Allow expressions in more locations in Connectors URIs (PR #7220)
Previously, we only allowed expressions in very specific locations in Connectors URIs:
A path segment, like /users/{$args.id}
A query parameter's value, like /users?id={$args.id}
Expressions can now be used anywhere in or after the path of the URI.
For example, you can do @connect(http: {GET: "/users?{$args.filterName}={$args.filterValue}"}).
The result of any expression will always be percent encoded.
Note: Parts of this feature are only available when composing with Apollo Federation v2.11 or above (currently in preview).
Instrument coprocessor request with http_request span (Issue #6739)
Coprocessor requests will now emit an http_request span. This span can help to gain
insight into latency that may be introduced over the network stack when communicating with coprocessor.
Enables reporting for client libraries that send the library name and version information in operation requests. (PR #7264)
Apollo client libraries can send the library name and version information in the extensions key of an operation request. If those values are found in a request the router will include them in the telemetry operation report sent to Apollo.
The compute job pool in the router is used to execute CPU intensive work outside of the main I/O worker threads, including GraphQL parsing, query planning, and introspection.
This PR adds spans to jobs that are on this pool to allow users to see when latency is introduced due to
resource contention within the compute job pool.
Jobs are executed highest priority (P8) first. Jobs that are low priority (P1) age over time, eventually executing
at highest priority. The age of a job is can be used to diagnose if a job was waiting in the queue due to other higher
priority jobs also in the queue.
Allow JWT authorization options to support multiple issuers using the same JWKS.
Configuration change: any issuer defined on currently existing authentication.router.jwt.jwks needs to be
migrated to an entry in the issuers list. This configuration will happen automatically until the next major version of the router. This change can be committed using ./router config upgrade prior to the next major release.
This fixes the apollo.router.operations.authentication.jwt counter metric to behave as documented: emitted for every request that uses JWT, with the authentication.jwt.failed attribute set to true or false for failed or successful authentication.
Previously, it was only used for failed authentication.
The attribute-less and accidentally-differently-named apollo.router.operations.jwt counter was and is only emitted for successful authentication, but is deprecated now.
The tracing_subscriber crate uses RwLocks to manage access to a Span's Extensions. Deadlocks are possible when
multiple threads access this lock, including with reentrant locks:
// Thread 1 | // Thread 2
let _rg1 = lock.read(); |
| // will block
| let _wg = lock.write();
// may deadlock |
let _rg2 = lock.read(); |
This fix removes an opportunity for reentrant locking while extracting a Datadog identifier.
There is also a potential for deadlocks when the root and active spans' Extensions are acquired at the same time, if
multiple threads are attempting to access those Extensions but in a different order. This fix removes a few cases
where multiple spans' Extensions are acquired at the same time.
The compute job pool is used within the router for compute intensive jobs that should not block the Tokio worker threads.
When this pool becomes saturated it is difficult for users to see why so that they can take action.
This change adds new metrics to help users understand how lon
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Mar 19, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Mar 20, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Mar 29, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Mar 29, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Apr 5, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Apr 6, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Apr 6, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Apr 6, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Apr 7, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Apr 7, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Jul 14, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Jul 14, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Jul 17, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Jul 17, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Jul 26, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Jul 26, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Jul 27, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Jul 27, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Jul 29, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
chore(deps): update ghcr.io/apollographql/router docker tag to v2
Jul 30, 2025
renovatebot
changed the title
chore(deps): update ghcr.io/apollographql/router docker tag to v2
chore(deps): update ghcr.io/apollographql/router docker tag to v2 - autoclosed
Aug 2, 2025
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
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.
This PR contains the following updates:
v1.32.0->v2.5.0Release Notes
apollographql/router (ghcr.io/apollographql/router)
v2.5.0Compare Source
🚀 Features
Introduce per-origin CORS policies (PR #7853)
Configuration can now specify different Cross-Origin Resource Sharing (CORS) rules for different origins using the
cors.policieskey. See the CORS documentation for details.By @Velfi in https://github.com/apollographql/router/pull/7853
jemalloc metrics (PR #7735)
This PR adds the following new metrics when running the router on Linux with its default
global-allocatorfeature:munmap(2)or similar.By @Velfi in https://github.com/apollographql/router/pull/7735
🐛 Fixes
Coprocessor: improve handling of invalid GraphQL responses with conditional validation (PR #7731)
The router was creating invalid GraphQL responses internally, especially when subscriptions terminate. When a coprocessor is configured, it validates all responses for correctness, causing errors to be logged when the router generates invalid internal responses. This affects the reliability of subscription workflows with coprocessors.
Fix handling of invalid GraphQL responses returned from coprocessors, particularly when used with subscriptions. Added conditional response validation and improved testing to ensure correctness. Added the
response_validationconfiguration option at the coprocessor level to enable the response validation (by default it's enabled).By @BrynCooke in https://github.com/apollographql/router/pull/7731
Fix deduplicated subscriptions hanging when one subscription closes (PR #7879)
Fixes a regression introduced in v1.50.0. When multiple client subscriptions are deduped onto a single subgraph subscription in WebSocket passthrough mode, and the first client subscription closes, the Router would close the subgraph subscription. The other deduplicated subscriptions would then silently stop receiving events.
Now outgoing subscriptions to subgraphs are kept open as long as any client subscription uses them.
By @bnjjj in https://github.com/apollographql/router/pull/7879
Fix several hot reload issues with subscriptions (PR #7746)
When a hot reload is triggered by a configuration change, the router attempted to apply updated configuration to open subscriptions. This could cause excessive logging.
When a hot reload was triggered by a schema change, the router closed subscriptions with a
SUBSCRIPTION_SCHEMA_RELOADerror. This happened before the new schema was fully active and warmed up, so clients could reconnect to the old schema, which should not happen.To fix these issues, a configuration and a schema change now have the same behavior. The router waits for the new configuration and schema to be active, and then closes all subscriptions with a
SUBSCRIPTION_SCHEMA_RELOAD/SUBSCRIPTION_CONFIG_RELOADerror, so clients can reconnect.By @goto-bus-stop and @bnjjj in https://github.com/apollographql/router/pull/7777
Fix error when removing non-UTF-8 headers with Rhai plugin (PR #7801)
When trying to remove non-UTF-8 headers from a Rhai plugin, users were faced with an unhelpful error. Now, non-UTF-8 values will be lossy converted to UTF-8 when accessed from Rhai. This change affects
get,get_all, andremoveoperations.By @Velfi in https://github.com/apollographql/router/pull/7801
Query planning errors with progressive override on interface implementations (PR #7929)
The router now correctly generates query plans when using progressive override (
@overridewith labels) on types that implement interfaces within the same subgraph. Previously, the Rust query planner would fail to generate plans for these scenarios with the error"Was not able to find any options for {}: This shouldn't have happened.", while the JavaScript planner handled them correctly.This fix resolves planning failures when your schema uses:
The router will now successfully plan and execute queries that previously resulted in query planning errors.
By @TylerBloom in https://github.com/apollographql/router/pull/7929
Fix startup hang with an empty Persisted Queries list (PR #7831)
When the Persisted Queries feature is enabled, the router no longer hangs during startup when using a GraphOS account with no Persisted Queries manifest.
Remove
@from error paths (Issue #4548)When a subgraph returns an unexpected response (ie not a body with at least one of
errorsordata), the errors surfaced by the router include an@in the path which indicates an error applied to all elements in the array. This is not a behavior defined in the GraphQL spec and is not easily parsed.This fix expands the
@symbol to reflect all paths that the error applies to.Example
Consider a federated graph with two subgraphs,
productsandinventory, and atopProductsquery which fetches a list of products fromproductsand then fetches an inventory status for each product.A successful response might look like:
{ "data": { "topProducts": [ {"name": "Table", "inStock": true}, {"name": "Chair", "inStock": false} ] } }Prior to this change, if the
inventorysubgraph returns a malformed response, the router response would look like:{ "data": {"topProducts": [{"name": "Table", "inStock": null}, {"name": "Chair", "inStock": null}]}, "errors": [ { "message": "service 'inventory' response was malformed: graphql response without data must contain at least one error", "path": ["topProducts", "@​"], "extensions": {"service": "inventory", "reason": "graphql response without data must contain at least one error", "code": "SUBREQUEST_MALFORMED_RESPONSE"} } ] }With this change, the response will look like:
{ "data": {"topProducts": [{"name": "Table", "inStock": null}, {"name": "Chair", "inStock": null}]}, "errors": [ { "message": "service 'inventory' response was malformed: graphql response without data must contain at least one error", "path": ["topProducts", 0], "extensions": {"service": "inventory", "reason": "graphql response without data must contain at least one error", "code": "SUBREQUEST_MALFORMED_RESPONSE"} }, { "message": "service 'inventory' response was malformed: graphql response without data must contain at least one error", "path": ["topProducts", 1], "extensions": {"service": "inventory", "reason": "graphql response without data must contain at least one error", "code": "SUBREQUEST_MALFORMED_RESPONSE"} } ] }The above examples reflect the behavior with
include_subgraph_errors = true; ifinclude_subgraph_errorsis false:{ "data": {"topProducts": [{"name": "Table", "inStock": null}, {"name": "Chair", "inStock": null}]}, "errors": [ { "message": "Subgraph errors redacted", "path": ["topProducts", 0] }, { "message": "Subgraph errors redacted", "path": ["topProducts", 1] } ] }By @carodewig in https://github.com/apollographql/router/pull/7684
Remove use of APOLLO_TELEMETRY_DISABLED from the fleet detector plugin (PR #7907)
The
APOLLO_TELEMETRY_DISABLEDenvironment variable only disables anonymous telemetry, it was never meant for disabling identifiable telemetry. This includes metrics from the fleet detection plugin.By @DMallare in https://github.com/apollographql/router/pull/7907
v2.4.0Compare Source
🚀 Features
Support JWT audience (
aud) validation (PR #7578)The router now supports JWT audience (
aud) validation. This allows the router to ensure that the JWT is intendedfor the specific audience it is being used with, enhancing security by preventing token misuse across different audiences.
The following sample configuration will validate the JWT's
audclaim against the specified audiences and ensure a match with eitherhttps://my.apiorhttps://my.other.api. If theaudclaim does not match either of those configured audiences, the router will reject the request.By @Velfi in https://github.com/apollographql/router/pull/7578
Prioritize existing requests over query parsing and planning during "warm up" (PR #7223)
The router warms up its query planning cache during a hot reload. This change decreases the priority
of warm up tasks in the compute job queue to reduce the impact of warmup on serving requests.
This change adds new values to the
job.typedimension of the following metrics:apollo.router.compute_jobs.duration- A histogram of time spent in the compute pipeline by the job, including the queue and query planning.job.type: (query_planning,query_parsing,introspection,query_planning_warmup,query_parsing_warmup)job.outcome: (executed_ok,executed_error,channel_error,rejected_queue_full,abandoned)apollo.router.compute_jobs.queue.wait.duration- A histogram of time spent in the compute queue by the job.job.type: (query_planning,query_parsing,introspection,query_planning_warmup,query_parsing_warmup)apollo.router.compute_jobs.execution.duration- A histogram of time spent to execute job (excludes time spent in the queue).job.type: (query_planning,query_parsing,introspection,query_planning_warmup,query_parsing_warmup)apollo.router.compute_jobs.active_jobs- A gauge of the number of compute jobs being processed in parallel.job.type: (query_planning,query_parsing,introspection,query_planning_warmup,query_parsing_warmup)By @carodewig in https://github.com/apollographql/router/pull/7223
Persisted queries: include operation name in
PERSISTED_QUERY_NOT_IN_LISTerror for debuggability (PR #7768)When persisted query safelisting is enabled and a request has an unknown PQ ID, the GraphQL error now has the extension field
operation_namecontaining the GraphQL operation name (if provided explicitly in the request). Note that this only applies to thePERSISTED_QUERY_NOT_IN_LISTerror returned when manifest-based PQs are enabled, APQs are disabled, and the request contains an operation ID that is not in the list.By @glasser in https://github.com/apollographql/router/pull/7768
Introduce cooperative cancellation for query planning
The cooperative cancellation feature allows the router to gracefully handle query planning timeouts and cancellations, improving resource utilization.
The
modecan be set tomeasureorenforce. We recommend starting withmeasure. Inmeasuremode, the router will measure the time taken for query planning and emit metrics accordingly. Inenforcemode, the router will cancel query planning operations that exceed the specified timeout.To observe this behavior, the router telemetry has been updated:
outcomeattribute to theapollo.router.query_planning.plan.durationmetricoutcomeattribute to thequery_planningspanBelow is a sample configuration to configure cooperative cancellation in measure mode:
By @Velfi in https://github.com/apollographql/router/pull/7604
🐛 Fixes
Align
on_graphql_errorselector withsubgraph_on_graphql_error(PR #7676)The
on_graphql_errorselector will now returntrueorfalse, in alignment with thesubgraph_on_graphql_errorselector. Previously, the selector would returntrueorNone.By @carodewig in https://github.com/apollographql/router/pull/7676
Return valid GraphQL response when performing a websocket handshake (PR #7680)
PR #7141 added checks on GraphQL responses returned from coprocessors to ensure compliance with GraphQL specifications. This surfaced an issue where subscription responses over websockets could omit the required
datafield during the handshake, resulting in invalid GraphQL response payloads. All websocket subscription responses will now return a valid GraphQL response when doing the websocket handshake.By @bnjjj in https://github.com/apollographql/router/pull/7680
Fix SigV4 configuration handling (PR #7726)
Fixed an issue introduced in Router 2.3.0 where some SigV4 configurations would fail to start, preventing communication with SigV4-enabled services.
By @dylan-apollo in https://github.com/apollographql/router/pull/7726
Improve error message for invalid variables (Issue #2984)
When a variable in a GraphQL request is missing or contains an invalid value, the router now returns more useful error messages. Example:
By @SimonSapin in https://github.com/apollographql/router/pull/7567
Support exporting resources on all Prometheus metrics (PR #7394)
By default, the Prometheus metrics exporter will only export resources as
target_infometrics, not inline on every metric. Now, you can add resources to every metric by settingresource_selectortoall(default isnone).Note: this change only affects Prometheus, not OTLP.
By @bnjjj in https://github.com/apollographql/router/pull/7394
Forbid unknown
@linkdirectives for supergraph schemas wherepurposeisEXECUTIONorSECURITYThe legacy JavaScript query planner forbid any usage of unknown
@linkspecs in supergraph schemas with eitherEXECUTIONorSECURITYvalue set for theforargument (aka, the spec's "purpose"). This behavior had not been ported to the native query planner previously. This PR implements the expected behavior in the native query planner.By @duckki in https://github.com/apollographql/router/pull/7587
Supergraph stage correctly receives
on_graphql_errorselector (PR #7669)The
on_graphql_errorselector will now correctly fire on the supergraph stage; previously it only worked on the router stage.By @carodewig in https://github.com/apollographql/router/pull/7669
Invalid type condition in
@deferfetchThe query planner was adding an inline spread (
...) conditioned on theQuerytype in deferred subgraph fetch queries. Such a query would be invalid in the subgraph when the subgraph schema renamed the rootquerytype to somethhing other thanQuery. The fix removes the root type condition from all subgraph queries, so that they stay valid even when root types are renamed.By @duckki in https://github.com/apollographql/router/pull/7580
Preserve
content-typefor file uploads when Rhai scripts are in use (PR #7559)If a Rhai script was invoked during file upload processing, then the "Content-Type" of the request was not preserved correctly. This would cause a file upload to fail.
The error message would be something like:
This issue has now been fixed.
By @garypen in https://github.com/apollographql/router/pull/7559
Improve OTLP metric HTTP endpoint behavior (PR #7595)
We made substantial updates to OpenTelemetry in router 2.0, but didn't catch that OpenTelemetry changed how it processed "endpoints" (destinations for metrics and traces) until now.
With the undetected change, the router wasn't setting the path correctly, resulting in failure to export metrics over HTTP when using the "default" endpoint. Neither metrics via gRPC nor traces were impacted.
We have fixed our interactions with the dependency and improved our testing to make sure this does not occur again. Additionally, the router now supports setting standard OpenTelemetry environment variables for endpoints.
There is still a known problem when using environment variables to configure endpoints for the HTTP protocol when transmitting to an un-encrypted endpoint (i.e., TLS not configured). This affects the following environment variables:
OTEL_EXPORTER_OTLP_ENDPOINTOTEL_EXPORTER_OTLP_METRICS_ENDPOINTOTEL_EXPORTER_OTLP_TRACES_ENDPOINTWhen these environment variables are set to insecure hosts, messages will appear in the logs indicating an error, but the metrics and traces will still be sent correctly:
This is tracked upstream at https://github.com/open-telemetry/opentelemetry-collector/issues/10952.
By @garypen in https://github.com/apollographql/router/pull/7595
Add
graphql.operation.nameattribute toapollo.router.opened.subscriptionscounter (PR #7606)The
apollo.router.opened.subscriptionsmetric has angraphql.operation.nameattribute applied to identify the named operation of open subscriptions.By @bnjjj in https://github.com/apollographql/router/pull/7606
🛠 Maintenance
Measure
preview_extended_error_metricsin Apollo config telemetry (PR #7597)By @timbotnik in https://github.com/apollographql/router/pull/7597
📚 Documentation
Document Apollo Runtime Container deployment (PR #7734 and PR #7668)
The Apollo Runtime Container is now included in our documentation for deployment options. It also includes instructions for running Apollo Router with the Apollo MCP Server.
By @jonathanrainer and @lambertjosh in https://github.com/apollographql/router/pull/7734 and https://github.com/apollographql/router/pull/7668
Fix incorrect reference to
apollo.router.schema.load.duration(PR #7582)The in-memory cache documentation was referencing an incorrect metric to track schema load times. Previously it was referred to as
apollo.router.schema.loading.time, whereas the metric being emitted by the router since v2.0.0 is actuallyapollo.router.schema.load.duration. This is now fixed.By @lrlna in https://github.com/apollographql/router/pull/7582
v2.3.0Compare Source
🚀 Features
Connectors improvements: Router 2.3.0 supports Connect spec v0.2, including batch requests, error customization, and direct access to HTTP headers. To use these features: upgrade your Router to 2.3, update your version of Federation to 2.11, and update the @link directives in your subgraphs to https://specs.apollo.dev/connect/v0.2.
See the Connectors changelog for more details.
Log whether safe-listing enforcement was skipped (Issue #7509)
When logging unknown operations encountered during safe-listing, include information about whether enforcement was skipped. This will help distinguish between truly problematic external operations (where
enforcement_skippedis false) and internal operations that are intentionally allowed to bypass safelisting (whereenforcement_skippedis true).By @DaleSeo in https://github.com/apollographql/router/pull/7509
Add response body telemetry selector (PR #7363)
The Router now supports a
response_bodyselector which provides access to the response body in telemetry configurations. This enables more detailed monitoring and logging of response data in the Router.Example configuration:
By @Velfi in https://github.com/apollographql/router/pull/7363
Support non-JSON and JSON-like content types for connectors (PR #7380)
Connectors now inspect the
content-typeheader of responses to determine how they should treat the response. This allows more flexibility as prior to this change, all responses were treated as JSON which would lead to errors on non-json responses.The behavior is as follows:
content-typeends with/json(likeapplication/json) OR+json(likeapplication/vnd.foo+json): content is parsed as JSON.content-typeistext/plain: content will be treated as a UTF-8string. Content can be accessed inselectionmapping via$variable.content-typeis any other value: content will be treated as a JSONnull.content-typeheader is provided: content is assumed to be JSON and therefore parsed as JSON.If deserialization fails, an error message of
Response deserialization failedwith a error code ofCONNECTOR_DESERIALIZEwill be returned:By @andrewmcgivery in https://github.com/apollographql/router/pull/7380
Include message and path for certain errors in Apollo telemetry (PR #7378)
For errors pertaining to connectors and demand control features, Apollo telemetry will now include the original error message and path as part of the traces sent to GraphOS.
By @timbotnik in https://github.com/apollographql/router/pull/7378
Support ignoring specific headers during subscriptions deduplication (PR #7070)
The Router now supports ignoring specific headers when deduplicating requests to subgraphs which provide subscription events. Previously, any differing headers which didn't actually affect the subscription response (e.g.,
user-agent) would prevent or limit the potential of deduplication.The introduction of the
ignored_headersoption allows you to specify headers to ignore during deduplication, enabling you to benefit from subscription deduplication even when requests include headers with unique or varying values that don't affect the subscription's event data.Configuration example:
By @bnjjj in https://github.com/apollographql/router/pull/7070
🐛 Fixes
Support disabling the health check endpoint (PR #7519)
During the development of Router 2.0, the health check endpoint support was converted to be a plugin. Unfortunately, the support for disabling the health check endpoint was lost during the conversion.
This is now fixed and a new unit test ensures that disabling the health check does not result in the creation of a health check endpoint.
By @garypen in https://github.com/apollographql/router/pull/7519
Propagate client name and version modifications through telemetry (PR #7369)
The Router accepts modifications to the client name and version (
apollo::telemetry::client_nameandapollo::telemetry::client_version), but those modifications were not propagated through the telemetry layers to update spans and traces.After this change, the modifications from plugins on the
routerservice are propagated through the telemetry layers.By @carodewig in https://github.com/apollographql/router/pull/7369
Prevent connectors error when using a variable in a nested input argument (PR #7472)
The connectors plugin will no longer error when using a variable in a nested input argument. The following example would error prior to this change:
By @andrewmcgivery in https://github.com/apollographql/router/pull/7472
Spans should only include path in
http.route(PR #7390)Per the OpenTelemetry spec, the
http.routeshould only include "the matched route, that is, the path template used in the format used by the respective server framework."Prior to this change, the Router sends the full URI in
http.route, which can be high cardinality (ie/graphql?operation=one_of_many_values). The Router will now only include the path (/graphql).By @carodewig in https://github.com/apollographql/router/pull/7390
Decrease log level for JWT authentication failure (PR #7396)
A recent change increased the log level of JWT authentication failures from
infotoerror. This reverts that change.By @carodewig in https://github.com/apollographql/router/pull/7396
Prefer headers propagated with Router YAML config over headers from Connector directives (PR #7499)
When configuring the same header name in both
@connect(http: { headers: })(or@source(http: { headers: })) in SDL andpropagatein Router YAML configuration, the request had both headers, even if the value is the same. After this change, Router YAML configuration always wins.By @andrewmcgivery in https://github.com/apollographql/router/pull/7499
Fixed native query planner regression not forbidding unknown spec links
The legacy JavaScript query planner forbids any usage of unknown
@linkspecs in supergraph schemas with eitherEXECUTIONorSECURITYvalue set for theforargument (aka, the spec's "purpose"). This behavior had not been ported to the native query planner previously. This PR implements the expected behavior in the native query planner.By @duckki in https://github.com/apollographql/router/pull/7587
(Query Planner) Fix invalid type condition in
@deferfetchThe query planner could add an inline spread conditioned on the
Querytype in deferred subgraph fetch queries. Such a query would be invalid in the subgraph when the subgraph schema renamed the root query type. This fix removes the root type condition from all subgraph queries, so that they stay valid even when root types were renamed.By @duckki in https://github.com/apollographql/router/pull/7580
🛠 Maintenance
Add timeouts and connection health checks to Redis connections (Issue #6855)
The Router's internal Redis configuration has been improved to increase client resiliency under various failure modes (TCP failures and timeouts, unresponsive sockets, Redis server failures, etc.). It also adds heartbeats (a PING every 10 seconds) to the Redis clients.
By @aembke, @carodewig in https://github.com/apollographql/router/pull/7526
📚 Documentation
Fix discrepancies in coprocessor metrics documentation (PR #7359)
The documentation for standard metric instruments for coprocessors has been updated:
apollo.router.operations.coprocessor.totaltoapollo.router.operations.coprocessorcoprocessor.succeededattribute applies toapollo.router.operations.coprocessoronly.By @shorgi in https://github.com/apollographql/router/pull/7359
Add example Rhai script for returning Demand Control metrics as response headers (PR #7564)
A new section has been added to the demand control documentation to demonstrate how to use Rhai scripts to expose cost estimation data in response headers. This allows clients to see the estimated cost, actual cost, and other demand control metrics directly in HTTP responses, which is useful for debugging and client-side optimization.
By @abernix in https://github.com/apollographql/router/pull/7564
v2.2.1Compare Source
🐛 Fixes
Redis connection leak on schema changes (PR #7319)
The router performs a 'hot reload' whenever it detects a schema update. During this reload, it effectively instantiates a new internal router, warms it up (optional), redirects all traffic to this new router, and drops the old internal router.
This change fixes a bug in that "drop" process where the Redis connections are never told to terminate, even though the Redis client pool is dropped. This leads to an ever-increasing number of inactive Redis connections as each new schema comes in and goes out of service, which eats up memory.
The solution adds a new up-down counter metric,
apollo.router.cache.redis.connections, to track the number of open Redis connections. This metric includes akindlabel to discriminate between different Redis connection pools, which mirrors thekindlabel on other cache metrics (ieapollo.router.cache.hit.time).By @carodewig in https://github.com/apollographql/router/pull/7319
Propagate client name and version modifications through telemetry (PR #7369)
The router accepts modifications to the client name and version (
apollo::telemetry::client_nameandapollo::telemetry::client_version), but those modifications are not currently propagated through the telemetry layers to update spans and traces.This PR moves where the client name and version are bound to the span, so that the modifications from plugins on the
routerservice are propagated.By @carodewig in https://github.com/apollographql/router/pull/7369
Progressive overrides are not disabled when connectors are used (PR #7351)
Prior to this fix, introducing a connector disabled the progressive override plugin.
By @lennyburdette in https://github.com/apollographql/router/pull/7351
Avoid unnecessary cloning in the deduplication plugin (PR #7347)
The deduplication plugin always cloned responses, even if there were not multiple simultaneous requests that would benefit from the cloned response.
We now check to see if deduplication will provide a benefit before we clone the subgraph response.
There was also an undiagnosed race condition which meant that a notification could be missed. This would have resulted in additional work being performed as the missed notification would have led to another subgraph request.
By @garypen in https://github.com/apollographql/router/pull/7347
Spans should only include path in
http.route(PR #7390)Per the OpenTelemetry spec, the
http.routeshould only include "the matched route, that is, the path template used in the format used by the respective server framework."The router currently sends the full URI in
http.route, which can be high cardinality (ie/graphql?operation=one_of_many_values). After this change, the router will only include the path (/graphql).By @carodewig in https://github.com/apollographql/router/pull/7390
Decrease log level for JWT authentication failure (PR #7396)
A recent change inadvertently increased the log level of JWT authentication failures from
infotoerror. This reverts that change returning it to the previous behavior.By @carodewig in https://github.com/apollographql/router/pull/7396
Avoid fractional decimals when generating
apollo.router.operations.batching.sizemetrics for GraphQL request batch sizes (PR #7306)Corrects the calculation of the
apollo.router.operations.batching.sizemetric to reflect accurate batch sizes rather than occasionally returning fractional numbers.By @bnjjj in https://github.com/apollographql/router/pull/7306
📃 Configuration
Log warnings for deprecated coprocessor
contextconfiguration usage (PR #7349)context: trueis an alias forcontext: deprecatedbut should not be used. The router now logs a runtime warning on startup if you do use it.Instead of:
Explicitly use
deprecatedorall:See the 2.x upgrade guide for more detailed upgrade steps.
By @goto-bus-stop in https://github.com/apollographql/router/pull/7349
🛠 Maintenance
Linux: Compatibility with glibc 2.28 or newer (PR #7355)
The default build images provided in our CI environment have a relatively modern version of
glibc(2.35). This means that on some distributions, notably those based around RedHat, it wasn't possible to use our binaries since the version ofglibcwas older than 2.35.We now maintain a build image which is based on a distribution with
glibc2.28. This is old enough that recent releases of either of the main Linux distribution families (Debian and RedHat) can make use of our binary releases.By @garypen in https://github.com/apollographql/router/pull/7355
Reject
@skip/@includeon subscription root fields in validation (PR #7338)This implements a GraphQL spec RFC, rejecting subscriptions in validation that can be invalid during execution.
By @goto-bus-stop in https://github.com/apollographql/router/pull/7338
📚 Documentation
Query planning best practices (PR #7263)
Added a new page under Routing docs about Query Planning Best Practices.
By @smyrick in https://github.com/apollographql/router/pull/7263
v2.2.0Compare Source
🚀 Features
Add support for connector header propagation via YAML config (PR #7152)
Added support for connector header propagation via YAML config. All of the existing header propagation in the Router now works for connectors by using
headers.connector.allto apply rules to all connectors orheaders.connector.sources.*to apply rules to specific sources.Note that if one of these rules conflicts with a header set in your schema, either in
@connector@source, the value in your Router config willtake priority and be treated as an override.
By @andrewmcgivery in https://github.com/apollographql/router/pull/7152
Enable configuration auto-migration for minor version bumps (PR #7162)
To facilitate configuration evolution within major versions of the router's lifecycles (e.g., within 2.x.x versions), YAML configuration migrations are applied automatically. To avoid configuration drift and facilitate maintenance, when upgrading to a new major version the migrations from the previous major (e.g., 1.x.x) will not be applied automatically. These will need to be applied with
router config upgradeprior to the upgrade. To facilitate major version upgrades, we recommend regularly applying the configuration changes usingrouter config upgradeand committing those to your version control system.By @bnjjj in https://github.com/apollographql/router/pull/7162
Allow expressions in more locations in Connectors URIs (PR #7220)
Previously, we only allowed expressions in very specific locations in Connectors URIs:
/users/{$args.id}/users?id={$args.id}Expressions can now be used anywhere in or after the path of the URI.
For example, you can do
@connect(http: {GET: "/users?{$args.filterName}={$args.filterValue}"}).The result of any expression will always be percent encoded.
By @dylan-apollo in https://github.com/apollographql/router/pull/7220
Enables reporting of persisted query usage by PQ ID to Apollo (PR #7166)
This change allows the router to report usage metrics by persisted query ID to Apollo, so that we can show usage stats for PQs.
By @bonnici in https://github.com/apollographql/router/pull/7166
Instrument coprocessor request with
http_requestspan (Issue #6739)Coprocessor requests will now emit an
http_requestspan. This span can help to gaininsight into latency that may be introduced over the network stack when communicating with coprocessor.
Coprocessor span attributes are:
otel.kind:CLIENThttp.request.method:POSTserver.address:<target address>server.port:<target port>url.full:<url.full>otel.name:<method> <url.full>otel.original_name:http_requestBy @theJC in https://github.com/apollographql/router/pull/6776
Enables reporting for client libraries that send the library name and version information in operation requests. (PR #7264)
Apollo client libraries can send the library name and version information in the
extensionskey of an operation request. If those values are found in a request the router will include them in the telemetry operation report sent to Apollo.By @calvincestari in https://github.com/apollographql/router/pull/7264
Add compute job pool spans (PR #7236)
The compute job pool in the router is used to execute CPU intensive work outside of the main I/O worker threads, including GraphQL parsing, query planning, and introspection.
This PR adds spans to jobs that are on this pool to allow users to see when latency is introduced due to
resource contention within the compute job pool.
compute_job:job.type: (query_parsing|query_planning|introspection)compute_job.executionjob.age:P1-P8job.type: (query_parsing|query_planning|introspection)Jobs are executed highest priority (
P8) first. Jobs that are low priority (P1) age over time, eventually executingat highest priority. The age of a job is can be used to diagnose if a job was waiting in the queue due to other higher
priority jobs also in the queue.
By @bryncooke in https://github.com/apollographql/router/pull/7236
JWT authorization supports multiple issuers (Issue #6172)
Allow JWT authorization options to support multiple issuers using the same JWKS.
Configuration change: any
issuerdefined on currently existingauthentication.router.jwt.jwksneeds to bemigrated to an entry in the
issuerslist. This configuration will happen automatically until the next major version of the router. This change can be committed using./router config upgradeprior to the next major release.For example, the following configuration:
Will be changed to contain an array of
issuersrather than a singleissuer:By @theJC in https://github.com/apollographql/router/pull/7170
🐛 Fixes
Fix JWT metrics discrepancy (PR #7258)
This fixes the
apollo.router.operations.authentication.jwtcounter metric to behave as documented: emitted for every request that uses JWT, with theauthentication.jwt.failedattribute set to true or false for failed or successful authentication.Previously, it was only used for failed authentication.
The attribute-less and accidentally-differently-named
apollo.router.operations.jwtcounter was and is only emitted for successful authentication, but is deprecated now.By @SimonSapin in https://github.com/apollographql/router/pull/7258
Fix potential telemetry deadlock (PR #7142)
The
tracing_subscribercrate usesRwLocks to manage access to aSpan'sExtensions. Deadlocks are possible whenmultiple threads access this lock, including with reentrant locks:
This fix removes an opportunity for reentrant locking while extracting a Datadog identifier.
There is also a potential for deadlocks when the root and active spans'
Extensionsare acquired at the same time, ifmultiple threads are attempting to access those
Extensionsbut in a different order. This fix removes a few caseswhere multiple spans'
Extensionsare acquired at the same time.By @carodewig in https://github.com/apollographql/router/pull/7142
Check if JWT claim is part of the context before getting the JWT expiration with subscriptions (PR #7069)
In v2.1.0 we introduced logs for the
jwt_expires_infunction which caused an unexpectedly chatty logging when using subscriptions.By @bnjjj in https://github.com/apollographql/router/pull/7069
Parse nested input types and report them (PR #6900)
Fixes a bug where enums that were arguments to nested queries were not being reported.
By @merylc in https://github.com/apollographql/router/pull/6900
Add compute job pool metrics (PR #7184)
The compute job pool is used within the router for compute intensive jobs that should not block the Tokio worker threads.
When this pool becomes saturated it is difficult for users to see why so that they can take action.
This change adds new metrics to help users understand how lon
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.