Skip to content

Commit

Permalink
Reconcile dev after merge to main for v1.43.0 (#4835)
Browse files Browse the repository at this point in the history
Follow-up to the v1.43.0 being officially released, bringing version
bumps and changelog updates into the `dev` branch.
  • Loading branch information
abernix authored Mar 22, 2024
2 parents ebf30e1 + 4b84858 commit 947936a
Show file tree
Hide file tree
Showing 29 changed files with 478 additions and 204 deletions.
5 changes: 0 additions & 5 deletions .changesets/feat_add_container_scaling_config.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changesets/feat_geal_jwks_headers.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changesets/feat_geal_jwt_source.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changesets/feat_geal_query_plan_refresh_ttl.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changesets/feat_geal_subgraph_unix_socket.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changesets/fix_bnjjj_multipart_test.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changesets/fix_bryn_datadog_trace_id.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changesets/fix_bryn_zipkin_service_name.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changesets/fix_format_response_index_map_with_capacity.md

This file was deleted.

94 changes: 89 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,91 @@ 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.43.0] - 2024-03-21

## 🚀 Features

### Support configurable heartbeat for subscriptions using the WebSocket protocol ([Issue #4621](https://github.com/apollographql/router/issues/4621))

To support GraphQL Subscription WebSocket implementations such as [DGS](https://netflix.github.io/dgs/) that drop idle connections by design, the router adds the ability to configure a heartbeat to keep active connections alive.

An example router configuration:

```yaml
subscription:
mode:
passthrough:
all:
path: /graphql
heartbeat_interval: enable # Optional
```

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

### Unix socket support for subgraphs ([Issue #3504](https://github.com/apollographql/router/issues/3504))

> ⚠️ This is an [Enterprise feature](https://www.apollographql.com/blog/platform/evaluating-apollo-router-understanding-free-and-open-vs-commercial-features/) of the Apollo Router. It requires an organization with a [GraphOS Enterprise plan](https://www.apollographql.com/pricing/).
>
> If your organization doesn't currently have an Enterprise plan, you can test out this functionality by signing up for a free Enterprise trial.

The router now supports Unix sockets for subgraph connections by specifying URLs in the `unix:///path/to/router.sock` format in the schema, in addition to coming a valid URL option within [the existing `override_subgraph_url` configuration](https://www.apollographql.com/docs/router/configuration/overview/#subgraph-routing-urls). The router uses Unix stream-oriented sockets (not datagram-oriented). It supports compression but not TLS.

Due to the lack of standardization of Unix socket URLs (and lack of support in the common URL types in Rust) a transformation is applied to to the socket path to parse it: the host is encoded in hexadecimal and stored in the `authority` part. This will have no consequence on the way the router functions, but [subgraph services](https://www.apollographql.com/docs/router/customizations/overview/#the-request-lifecycle) will receive URLs with the hex-encoded host.

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

### Add an option to refresh expiration on Redis GET ([Issue #4473](https://github.com/apollographql/router/issues/4473))

This adds the option to refresh the time-to-live (TTL) on Redis entries when they are accessed. We want the query plan cache to act like an LRU cache (least-recently used), so if a TTL is set in its Redis configuration, it should reset every time it is accessed.

While the option is also available for APQ, it's disabled for entity caching because that cache manages TTL directly.

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

### Helm: Support configuring `ContainerResource` on Horizontal Pod Autoscaler (HPA) targets ([PR #4776](https://github.com/apollographql/router/pull/4776))

The router supports configuration of the [`ContainerResource` type metric](https://kubernetes.io/blog/2023/05/02/hpa-container-resource-metric/) on Horizontal Pod Autoscaler (HPA) targets in the Helm chart with Kubernetes v1.27 or later.

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

## 🐛 Fixes

### Fix chunk formatting in multipart protocol ([Issue #4634](https://github.com/apollographql/router/issues/4634))

Previously, when sending a stream of chunks for HTTP multipart, the router finished each chunk by appending it with `\r\n`.
Now, the router doesn't append `\r\n` to the current chunk but instead prepends it to the next chunk. This enables the router to close a stream with the correct final boundary by appending `--\r\n` directly to the last chunk.

This PR changes the way we're sending chunks in the stream. Instead of finishing the chunk with `\r\n` we don't send this at the end of our current chunk but instead at the beginning of the next one. For the end users nothing changes but it let us to close the stream with the right final boundary by appending `--\r\n` directly to the last chunk.

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

### Zipkin service name not populated ([Issue #4807](https://github.com/apollographql/router/issues/4807))

The Zipkin trace exporter now respects service name configuration from YAML or environment variables.

For instance to set the service name to `my-app`, you can use the following configuration in your `router.yaml` file:

```yaml
telemetry:
exporters:
tracing:
common:
service_name: my-app
zipkin:
enabled: true
endpoint: default
```

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

## 🛠 Maintenance

### Preallocate response formatting output ([PR #4775](https://github.com/apollographql/router/pull/4775))

To improve runtime performance, an internal change to the router's `format_response` now preallocates the output object.

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

# [1.42.0] - 2024-03-12

## 🚀 Features
Expand Down Expand Up @@ -42,7 +127,6 @@ telemetry:
dd.trace_id: true
```


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

# [1.41.1] - 2024-03-08
Expand Down Expand Up @@ -173,7 +257,7 @@ By [@Geal](https://github.com/Geal) in https://github.com/apollographql/router/p

The `subgraph_response_body` [selector](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/selectors/) has been deprecated and replaced with selectors for a response body's constituent elements: `subgraph_response_data` and `subgraph_response_errors`.

When configuring `subgraph_response_data` and `subgraph_response_errors`, both use a JSONPath expression to fetch data or errors from a subgraph response.
When configuring `subgraph_response_data` and `subgraph_response_errors`, both use a JSONPath expression to fetch data or errors from a subgraph response.

An example configuration:

Expand All @@ -192,7 +276,7 @@ By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router

### Add a `.remove` method for headers in Rhai

The router supports a new `.remove` method that enables users to remove headers in a Rhai script.
The router supports a new `.remove` method that enables users to remove headers in a Rhai script.

For example:

Expand Down Expand Up @@ -348,9 +432,9 @@ By [@nicholascioli](https://github.com/nicholascioli) in https://github.com/apol

### Add selector to get all baggage key values in span attributes ([Issue #4425](https://github.com/apollographql/router/issues/4425))

Previously, baggage items were configured as standard attributes in `router.yaml`, and adding a new baggage item required a configuration update and router rerelease.
Previously, baggage items were configured as standard attributes in `router.yaml`, and adding a new baggage item required a configuration update and router rerelease.

This release supports a new configuration that enables baggage items to be added automatically as span attributes.
This release supports a new configuration that enables baggage items to be added automatically as span attributes.

If you have several baggage items and would like to add all of them directly as span attributes (for example, `baggage: my_item=test, my_second_item=bar`), setting `baggage: true` will add automatically add two span attributes, `my_item=test` and `my_second_item=bar`.

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.42.0"
version = "1.43.0"
dependencies = [
"access-json",
"anyhow",
Expand Down Expand Up @@ -410,7 +410,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.42.0"
version = "1.43.0"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -426,7 +426,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.42.0"
version = "1.43.0"
dependencies = [
"anyhow",
"cargo-scaffold",
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.42.0"
version = "1.43.0"
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.42.0"
version = "1.43.0"
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.42.0"
apollo-router = "1.43.0"
{{/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.42.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.43.0" }
{{/if}}
{{/if}}
anyhow = "1.0.58"
Expand Down
2 changes: 1 addition & 1 deletion apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "apollo-router"
version = "1.42.0"
version = "1.43.0"
authors = ["Apollo Graph, Inc. <[email protected]>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2431,15 +2431,24 @@ expression: "&schema"
"properties": {
"heartbeat_interval": {
"description": "Heartbeat interval for callback mode (default: 5secs)",
"default": "5s",
"default": "enabled",
"anyOf": [
{
"description": "disable heartbeat",
"type": "string",
"enum": [
"disabled"
]
},
{
"description": "enable with default interval of 5s",
"type": "string",
"enum": [
"enabled"
]
},
{
"description": "enable with custom interval, e.g. '100ms', '10s' or '1m'",
"type": "string"
}
]
Expand Down Expand Up @@ -2491,6 +2500,30 @@ expression: "&schema"
"default": null,
"type": "object",
"properties": {
"heartbeat_interval": {
"description": "Heartbeat interval for graphql-ws protocol (default: disabled)",
"default": "disabled",
"anyOf": [
{
"description": "disable heartbeat",
"type": "string",
"enum": [
"disabled"
]
},
{
"description": "enable with default interval of 5s",
"type": "string",
"enum": [
"enabled"
]
},
{
"description": "enable with custom interval, e.g. '100ms', '10s' or '1m'",
"type": "string"
}
]
},
"path": {
"description": "Path on which WebSockets are listening",
"default": null,
Expand Down Expand Up @@ -2518,6 +2551,30 @@ expression: "&schema"
"description": "WebSocket configuration for a specific subgraph",
"type": "object",
"properties": {
"heartbeat_interval": {
"description": "Heartbeat interval for graphql-ws protocol (default: disabled)",
"default": "disabled",
"anyOf": [
{
"description": "disable heartbeat",
"type": "string",
"enum": [
"disabled"
]
},
{
"description": "enable with default interval of 5s",
"type": "string",
"enum": [
"enabled"
]
},
{
"description": "enable with custom interval, e.g. '100ms', '10s' or '1m'",
"type": "string"
}
]
},
"path": {
"description": "Path on which WebSockets are listening",
"default": null,
Expand Down
Loading

0 comments on commit 947936a

Please sign in to comment.