Skip to content

Commit

Permalink
release: v1.48.1
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored Jun 10, 2024
2 parents 878dbc1 + f73ead6 commit 4a1d944
Show file tree
Hide file tree
Showing 25 changed files with 512 additions and 128 deletions.
Empty file.
97 changes: 75 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,59 @@ All notable changes to Router will be documented in this file.

This project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).

# [1.48.1] - 2024-06-10

## 🐛 Fixes

### Improve error message produced when a subgraph response doesn't include an expected `content-type` header value ([Issue #5359](https://github.com/apollographql/router/issues/5359))

To improve a common debuggability challenge when a subgraph response doesn't contain an expected `content-type` header value, the error message produced will include additional details about the error.

Some examples of the improved error message:

* ```
HTTP fetch failed from 'test': subgraph response contains invalid 'content-type' header value "application/json,application/json"; expected content-type: application/json or content-type: application/graphql-response+json
```
* ```
HTTP fetch failed from 'test': subgraph response does not contain 'content-type' header; expected content-type: application/json or content-type: application/graphql-response+json
```
By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/5223

### Update `apollo-compiler` for two small improvements ([PR #5347](https://github.com/apollographql/router/pull/5347))

Updated our underlying `apollo-rs` dependency on our `apollo-compiler` crate to bring in two nice improvements:

- _Fix validation performance bug_

Adds a cache in fragment spread validation, fixing a situation where validating a query with many fragment spreads against a schema with many interfaces could take multiple seconds to validate.

- _Remove ariadne byte/char mapping_

Generating JSON or CLI reports for apollo-compiler diagnostics used a translation layer between byte offsets and character offsets, which cost some computation and memory proportional to the size of the source text. The latest version of `ariadne` allows us to remove this translation.

By [@goto-bus-stop](https://github.com/goto-bus-stop) in https://github.com/apollographql/router/pull/5347

## 📃 Configuration

### Rename the telemetry selector which obtains the GraphOS operation id ([PR #5337](https://github.com/apollographql/router/pull/5337))

Renames a misnamed `trace_id` selector introduced in [v1.48.0](https://github.com/apollographql/router/releases/tag/v1.48.0) to the value which it actually represents which is an Apollo GraphOS operation ID, rather than a trace ID. Apologies for the confusion! Unfortunately, we aren't able to produce an Apollo GraphOS trace ID at this time.

If you want to access this operation ID selector, here is an example of how to apply it to your tracing spans:

```yaml
telemetry:
instrumentation:
spans:
router:
"studio.operation.id":
studio_operation_id: true
```

This can be useful for more easily locating the operation in [GraphOS' Insights](https://www.apollographql.com/docs/graphos/metrics/operations) feature and finding applicable traces in Studio.

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/5337

# [1.48.0] - 2024-05-29

## 🚀 Features
Expand Down Expand Up @@ -40,7 +93,7 @@ By [@bryncooke](https://github.com/bryncooke) in https://github.com/apollographq

### Ability to include Apollo Studio trace ID on tracing spans ([Issue #3803](https://github.com/apollographql/router/issues/3803)), ([Issue #5172](https://github.com/apollographql/router/issues/5172))

Add support for a new trace ID selector kind, the `apollo` trace ID, which represents the trace ID on [Apollo GraphOS Studio](https://studio.apollographql.com/).
Add support for a new trace ID selector kind, the `apollo` trace ID, which represents the trace ID on [Apollo GraphOS Studio](https://studio.apollographql.com/).

An example configuration using `trace_id: apollo`:

Expand Down Expand Up @@ -99,7 +152,7 @@ telemetry:
eq:
- true
- on_graphql_error: true
```
```

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/5221

Expand Down Expand Up @@ -204,7 +257,7 @@ telemetry:
- "topProducts"
```

Using the new instruments consumes significant performance resources from the router. Their performance will be improved in a future release.
Using the new instruments consumes significant performance resources from the router. Their performance will be improved in a future release.

Large numbers of metrics may also be generated by using the instruments, so make sure to not incur excessively large APM costs.

Expand All @@ -220,10 +273,10 @@ By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographq

### Support telemetry selectors with errors ([Issue #5027](https://github.com/apollographql/router/issues/5027))

The router now supports telemetry selectors that take into account the occurrence of errors. This capability enables you to create metrics, events, or span attributes that contain error messages.
The router now supports telemetry selectors that take into account the occurrence of errors. This capability enables you to create metrics, events, or span attributes that contain error messages.

For example, you can create a counter for the number of timed-out requests for subgraphs:


```yaml
telemetry:
Expand Down Expand Up @@ -323,7 +376,7 @@ By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographq

The router's hashing algorithm has been updated to prevent cache collisions when the router's configuration changes.

> [!IMPORTANT]
> [!IMPORTANT]
> If you have enabled [Distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), this release changes the hashing algorithm used for the cache keys. On account of this, you should anticipate additional cache regeneration cost when updating between these versions while the new hashing algorithm comes into service.

The router supports multiple options that affect the generated query plans, including:
Expand All @@ -338,22 +391,22 @@ If distributed query plan caching is enabled, changing any of these options resu
This could be problematic in the following scenarios:

1. The router configuration changes and a query plan is loaded from cache which is incompatible with the new configuration.
2. Routers with different configurations share the same cache, which causes them to cache and load incompatible query plans.
2. Routers with different configurations share the same cache, which causes them to cache and load incompatible query plans.

To prevent these from happening, the router now creates a hash for the entire query planner configuration and includes it in the cache key.

By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/5100

### 5xx internal server error responses returned as GraphQL structured errors ([PR #5159](https://github.com/apollographql/router/pull/5159))

Previously, the router returned internal server errors (5xx class) as plaintext to clients. Now in this release, the router returns these 5xx errors as structured GraphQL (for example, `{"errors": [...]}`).
Previously, the router returned internal server errors (5xx class) as plaintext to clients. Now in this release, the router returns these 5xx errors as structured GraphQL (for example, `{"errors": [...]}`).

Internal server errors are returned upon unexpected or unrecoverable disruptions to the GraphQL request lifecycle execution. When these occur, the underlying error messages are logged at an `ERROR` level to the router's logs.
By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/5159

### Custom telemetry events not created when logging is disabled ([PR #5165](https://github.com/apollographql/router/pull/5165))

The router has been fixed to not create custom telemetry events when the log level is set to `off`.
The router has been fixed to not create custom telemetry events when the log level is set to `off`.

An example configuration with `level` set to `off` for a custom event:

Expand Down Expand Up @@ -418,7 +471,7 @@ By [@kindermax](https://github.com/kindermax) in https://github.com/apollographq

The router now supports caching responses marked with `private` scope. This caching currently works only on subgraph responses without any schema-level information.

For details about the caching behavior, see [PR #4855](https://github.com/apollographql/router/pull/4855)
For details about the caching behavior, see [PR #4855](https://github.com/apollographql/router/pull/4855)


By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/pull/4855
Expand Down Expand Up @@ -449,12 +502,12 @@ telemetry:
on: request
attributes:
http.response.body.size: false
# Only log when the x-log-request header is `log`
# Only log when the x-log-request header is `log`
condition:
eq:
- "log"
- request_header: "x-log-request"

supergraph:
# Custom event configuration for supergraph service ...
subgraph:
Expand All @@ -467,7 +520,7 @@ By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router

The router now supports a configuration to ignore header prefixes with the JWT plugin. Given that many application headers use the format of `Authorization: <scheme> <token>`, this option enables the router to process requests for specific schemes within the `Authorization` header while ignoring others.

For example, you can configure the router to process requests with `Authorization: Bearer <token>` defined while ignoring others such as `Authorization: Basic <token>`:
For example, you can configure the router to process requests with `Authorization: Bearer <token>` defined while ignoring others such as `Authorization: Basic <token>`:

```yaml title="router.yaml"
authentication:
Expand All @@ -491,10 +544,10 @@ An example configuration using `condition` in `attributes` and `on_graphql_error
```yaml
telemetry:
instrumentation:
spans:
router:
attributes:
otel.status_description:
spans:
router:
attributes:
otel.status_description:
static: "there was an error"
condition:
any:
Expand Down Expand Up @@ -547,7 +600,7 @@ By [@tninesling](https://github.com/tninesling) in https://github.com/apollograp

### Filter fetches added to batch during batch creation ([PR #5034](https://github.com/apollographql/router/pull/5034))

Previously, the router didn't filter query hashes when creating batches. This could result in failed queries because the additional hashes could incorrectly make a query appear to be committed when it wasn't actually registered in a batch.
Previously, the router didn't filter query hashes when creating batches. This could result in failed queries because the additional hashes could incorrectly make a query appear to be committed when it wasn't actually registered in a batch.

This release fixes this issue by filtering query hashes during batch creation.

Expand All @@ -567,7 +620,7 @@ By [@garypen](https://github.com/garypen) in https://github.com/apollographql/ro

### Document traffic shaping default configuration ([PR #4953](https://github.com/apollographql/router/pull/4953))

The documentation for [configuring traffic shaping](https://www.apollographql.com/docs/router/configuration/traffic-shaping#configuration) has been updated to clarify that it's enabled by default with preset values. This setting has been the default since PR [#3330](https://github.com/apollographql/router/pull/3330), which landed in [v1.23.0](https://github.com/apollographql/router/releases/tag/v1.23.0).
The documentation for [configuring traffic shaping](https://www.apollographql.com/docs/router/configuration/traffic-shaping#configuration) has been updated to clarify that it's enabled by default with preset values. This setting has been the default since PR [#3330](https://github.com/apollographql/router/pull/3330), which landed in [v1.23.0](https://github.com/apollographql/router/releases/tag/v1.23.0).

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4953

Expand Down Expand Up @@ -602,7 +655,7 @@ By [@o0Ignition0o](https://github.com/o0Ignition0o) in https://github.com/apollo

### Use entire schema when hashing an introspection query ([Issue #5006](https://github.com/apollographql/router/issues/5006))

Correct a _different_ hashing bug which impacted introspection queries which was also introduced in [v1.44.0](https://github.com/apollographql/router/pull/4883). This other hashing bug failed to account for introspection queries, resulting in introspection results being misaligned to the current schema. This issue only affects Routers that use [distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), enabled via the `supergraph.query_planning.cache.redis.urls` configuration property.
Correct a _different_ hashing bug which impacted introspection queries which was also introduced in [v1.44.0](https://github.com/apollographql/router/pull/4883). This other hashing bug failed to account for introspection queries, resulting in introspection results being misaligned to the current schema. This issue only affects Routers that use [distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), enabled via the `supergraph.query_planning.cache.redis.urls` configuration property.

This release fixes the hashing mechanism by adding the schema string to hashed data if an introspection field is encountered. As a result, the entire schema is taken into account and the correct introspection result is returned.

Expand All @@ -625,7 +678,7 @@ By [@garypen](https://github.com/garypen) in https://github.com/apollographql/ro

### Query validation process with Rust ([PR #4551](https://github.com/apollographql/router/pull/4551))

The router has been updated with a new Rust-based query validation process using `apollo-compiler` from the `apollo-rs` project. It replaces the Javascript implementation in the query planner. It improves query planner performance by moving the validation out of the query planner and into the router service, which frees up space in the query planner cache.
The router has been updated with a new Rust-based query validation process using `apollo-compiler` from the `apollo-rs` project. It replaces the Javascript implementation in the query planner. It improves query planner performance by moving the validation out of the query planner and into the router service, which frees up space in the query planner cache.

Because validation now happens earlier in the router service and not in the query planner, error paths in the query planner are no longer encountered. Some messages in error responses returned from invalid queries should now be more clear.

Expand Down Expand Up @@ -961,7 +1014,7 @@ warning: unused import: `common::ValueExt`
| ^^^^^^^^^^^^^^^^
```

That issue is now resolved.
That issue is now resolved.

By [@garypen](https://github.com/garypen) in https://github.com/apollographql/router/pull/4919

Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1"

[[package]]
name = "apollo-compiler"
version = "1.0.0-beta.16"
version = "1.0.0-beta.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "175659cea0232b38bfacd1505aed00221cc4028d848699ce9e3422c6bf87d90a"
checksum = "a46c3a5e9a23a39089af6bada6fe0976369458434095bd9c26ce94c56f219842"
dependencies = [
"apollo-parser",
"ariadne",
Expand All @@ -220,7 +220,7 @@ dependencies = [

[[package]]
name = "apollo-federation"
version = "1.48.0"
version = "1.48.1"
dependencies = [
"apollo-compiler",
"derive_more",
Expand Down Expand Up @@ -262,7 +262,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.48.0"
version = "1.48.1"
dependencies = [
"access-json",
"anyhow",
Expand Down Expand Up @@ -425,7 +425,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.48.0"
version = "1.48.1"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -441,7 +441,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.48.0"
version = "1.48.1"
dependencies = [
"anyhow",
"cargo-scaffold",
Expand Down Expand Up @@ -501,9 +501,9 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6"

[[package]]
name = "ariadne"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd002a6223f12c7a95cdd4b1cb3a0149d22d37f7a9ecdb2cb691a071fe236c29"
checksum = "44055e597c674aef7cb903b2b9f6e4cba1277ed0d2d61dae7cd52d7ffa81f8e2"
dependencies = [
"concolor",
"unicode-width",
Expand Down Expand Up @@ -8227,9 +8227,9 @@ dependencies = [

[[package]]
name = "yansi"
version = "0.5.1"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"

[[package]]
name = "zerocopy"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ debug = 1
# Dependencies used in more than one place are specified here in order to keep versions in sync:
# https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
[workspace.dependencies]
apollo-compiler = "=1.0.0-beta.16"
apollo-compiler = "=1.0.0-beta.17"
apollo-parser = "0.7.6"
apollo-smith = { version = "0.5.0", features = ["parser-impl"] }
async-trait = "0.1.77"
Expand Down
2 changes: 1 addition & 1 deletion apollo-federation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-federation"
version = "1.48.0"
version = "1.48.1"
authors = ["The Apollo GraphQL Contributors"]
edition = "2021"
description = "Apollo Federation"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-benchmarks"
version = "1.48.0"
version = "1.48.1"
authors = ["Apollo Graph, Inc. <[email protected]>"]
edition = "2021"
license = "Elastic-2.0"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router-scaffold"
version = "1.48.0"
version = "1.48.1"
authors = ["Apollo Graph, Inc. <[email protected]>"]
edition = "2021"
license = "Elastic-2.0"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apollo-router = { path ="{{integration_test}}apollo-router" }
apollo-router = { git="https://github.com/apollographql/router.git", branch="{{branch}}" }
{{else}}
# Note if you update these dependencies then also update xtask/Cargo.toml
apollo-router = "1.48.0"
apollo-router = "1.48.1"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router-scaffold/templates/base/xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apollo-router-scaffold = { path ="{{integration_test}}apollo-router-scaffold" }
{{#if branch}}
apollo-router-scaffold = { git="https://github.com/apollographql/router.git", branch="{{branch}}" }
{{else}}
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.48.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.48.1" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.48.0"
version = "1.48.1"
authors = ["Apollo Graph, Inc. <[email protected]>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down Expand Up @@ -68,7 +68,7 @@ askama = "0.12.1"
access-json = "0.1.0"
anyhow = "1.0.80"
apollo-compiler.workspace = true
apollo-federation = { path = "../apollo-federation", version = "=1.48.0"}
apollo-federation = { path = "../apollo-federation", version = "=1.48.1" }
arc-swap = "1.6.0"
async-channel = "1.9.0"
async-compression = { version = "0.4.6", features = [
Expand Down
Loading

0 comments on commit 4a1d944

Please sign in to comment.