Skip to content

prep release: v1.60.0#6732

Merged
abernix merged 1 commit into1.60.0from
prep-1.60.0
Feb 5, 2025
Merged

prep release: v1.60.0#6732
abernix merged 1 commit into1.60.0from
prep-1.60.0

Conversation

@abernix
Copy link
Member

@abernix abernix commented Feb 5, 2025

Note

When approved, this PR will merge into the 1.60.0 branch which will — upon being approved itself — merge into main.

Things to review in this PR:

  • Changelog correctness (There is a preview below, but it is not necessarily the most up to date. See the Files Changed for the true reality.)
  • Version bumps
  • That it targets the right release branch (1.60.0 in this case!).

🚀 Features

Improve BatchProcessor observability (Issue #6558)

A new metric has been introduced to allow observation of how many spans are being dropped by an telemetry batch processor.

  • apollo.router.telemetry.batch_processor.errors - The number of errors encountered by exporter batch processors.
    • name: One of apollo-tracing, datadog-tracing, jaeger-collector, otlp-tracing, zipkin-tracing.
    • error = One of channel closed, channel full.

By observing the number of spans dropped it is possible to estimate what batch processor settings will work for you.

In addition, the log message for dropped spans will now indicate which batch processor is affected.

By @bryncooke in #6558

🐛 Fixes

Improve performance of query hashing by using a precomputed schema hash (PR #6622)

The router now uses a simpler and faster query hashing algorithm with more predictable CPU and memory usage. This improvement is enabled by using a precomputed hash of the entire schema, rather than computing and hashing the subset of types and fields used by each query.

For more details on why these design decisions were made, please see the PR description

By @IvanGoncharov in #6622

Truncate invalid error paths (PR #6359)

This fix addresses an issue where the router was silently dropping subgraph errors that included invalid paths.

According to the GraphQL Specification an error path must point to a response field:

If an error can be associated to a particular field in the GraphQL result, it must contain an entry with the key path that details the path of the response field which experienced the error.

The router now truncates the path to the nearest valid field path if a subgraph error includes a path that can't be matched to a response field,

By @IvanGoncharov in #6359

Eagerly init subgraph operation for subscription primary nodes (PR #6509)

When subgraph operations are deserialized, typically from a query plan cache, they are not automatically parsed into a full document. Instead, each node needs to initialize its operation(s) prior to execution. With this change, the primary node inside SubscriptionNode is initialized in the same way as other nodes in the plan.

By @tninesling in #6509

Fix increased memory usage in sysinfo since Router 1.59.0 (PR #6634)

In version 1.59.0, Apollo Router started using the sysinfo crate to gather metrics about available CPUs and RAM. By default, that crate uses rayon internally to parallelize its handling of system processes. In turn, rayon creates a pool of long-lived threads.

In a particular benchmark on a 32-core Linux server, this caused resident memory use to increase by about 150 MB. This is likely a combination of stack space (which only gets freed when the thread terminates) and per-thread space reserved by the heap allocator to reduce cross-thread synchronization cost.

This regression is now fixed by:

  • Disabling sysinfo’s use of rayon, so the thread pool is not created and system processes information is gathered in a sequential loop.
  • Making sysinfo not gather that information in the first place since Router does not use it.

By @SimonSapin in #6634

Optimize demand control lookup (PR #6450)

The performance of demand control in the router has been optimized.

Previously, demand control could reduce router throughput due to its extra processing required for scoring.

This fix improves performance by shifting more data to be computed at plugin initialization and consolidating lookup queries:

  • Cost directives for arguments are now stored in a map alongside those for field definitions
  • All precomputed directives are bundled into a struct for each field, along with that field's extended schema type. This reduces 5 individual lookups to a single lookup.
  • Response scoring was looking up each field's definition twice. This is now reduced to a single lookup.

By @tninesling in #6450

Fix missing Content-Length header in subgraph requests (Issue #6503)

A change in 1.59.0 caused the Router to send requests to subgraphs without a Content-Length header, which would cause issues with some GraphQL servers that depend on that header.

This solves the underlying bug and reintroduces the Content-Length header.

By @nmoutschen in #6538

🛠 Maintenance

Remove the legacy query planner (PR #6418)

The legacy query planner has been removed in this release. In the previous release, router v1.58, it was no longer used by default but was still available through the experimental_query_planner_mode configuration key. That key is now removed.

Also removed are configuration keys which were only relevant to the legacy planner:

  • supergraph.query_planning.experimental_parallelism: the new planner can always use available parallelism.
  • supergraph.experimental_reuse_query_fragments: this experimental algorithm that attempted to
    reuse fragments from the original operation while forming subgraph requests is no longer present. Instead, by default new fragment definitions are generated based on the shape of the subgraph operation.

By @SimonSapin in #6418

Migrate various metrics to OTel instruments (PR #6476, PR #6356, PR #6539)

Various metrics using our legacy mechanism based on the tracing crate are migrated to OTel instruments.

By @goto-bus-stop in #6476, #6356, #6539

📚 Documentation

Add instrumentation configuration examples (PR #6487)

The docs for router telemetry have new example configurations for common use cases for selectors and condition.

By @shorgi in #6487

🧪 Experimental

Remove experimental_retry option (PR #6338)

The experimental_retry option has been removed due to its limited use and functionality during its experimental phase.

By @bnjjj in #6338

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Feb 5, 2025

⚠️ Docs preview not attached to branch

The preview was not built because the PR's base branch 1.60.0 is not in the list of sources.

An Apollo team member can comment one of the following commands to dictate which branch to attach the preview to:

  • !docs set-base-branch dev
  • !docs set-base-branch 1.x

Build ID: 3d4309580b75c3bb96a9d8be

@router-perf
Copy link

router-perf bot commented Feb 5, 2025

CI performance tests

  • connectors-const - Connectors stress test that runs with a constant number of users
  • const - Basic stress test that runs with a constant number of users
  • demand-control-instrumented - A copy of the step test, but with demand control monitoring and metrics enabled
  • demand-control-uninstrumented - A copy of the step test, but with demand control monitoring enabled
  • enhanced-signature - Enhanced signature enabled
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • extended-reference-mode - Extended reference mode enabled
  • large-request - Stress test with a 1 MB request payload
  • no-tracing - Basic stress test, no tracing
  • reload - Reload test over a long period of time at a constant rate of users
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • step-local-metrics - Field stats that are generated from the router rather than FTV1
  • step-with-prometheus - A copy of the step test with the Prometheus metrics exporter enabled
  • step - Basic stress test that steps up the number of users over time
  • xlarge-request - Stress test with 10 MB request payload
  • xxlarge-request - Stress test with 100 MB request payload

@abernix abernix merged commit b9e9847 into 1.60.0 Feb 5, 2025
15 checks passed
@abernix abernix deleted the prep-1.60.0 branch February 5, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants