Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7b37a16
Merge remote-tracking branch 'origin/main' into dev
abernix Oct 25, 2022
fc966fa
docs: fix rhai example for import modules (#1968)
brh55 Oct 25, 2022
f12e7c5
fix(deps): update all non-major packages >= 1.0
renovate[bot] Oct 25, 2022
cd545d4
Split the configuration file management in multiple modules (#1996)
Oct 26, 2022
3604e49
convert to string to get the contents of the apollo_sdl variable (#2007)
fernando-apollo Oct 26, 2022
48780c4
add trace_id in logs to identify all logs related to a request/error …
bnjjj Oct 26, 2022
70a859c
fix(deps): update dependency @apollo/server to v4.0.4
renovate[bot] Oct 26, 2022
b23dff5
Faster scaffold test: share `target` and `Cargo.lock` with main works…
SimonSapin Oct 24, 2022
f9797e2
Update cargo-scaffold to 0.8.6
SimonSapin Oct 25, 2022
9d8b30f
Add a CI job for updated dependencies + Rust Nightly
SimonSapin Oct 25, 2022
af50f9a
uplink api semantics (#2001)
Oct 27, 2022
03b8553
fix(telemetry): improve detection of trace_id in text formatter (#2019)
bnjjj Oct 27, 2022
688f92b
improve the deduplication logic (#2014)
Oct 27, 2022
1239287
fix(deps): update rust crate miette to 5.4.1
renovate[bot] Oct 28, 2022
d52f8bb
fix logic in argument processing for diy docker build script (#2032)
Oct 31, 2022
62e6bd2
fixing router healthcheck formatting
dariuszkuc Oct 31, 2022
b074a50
fixing router healthcheck formatting (#2035)
Oct 31, 2022
abd9861
allow router installer to install aarch64 binaries (#2033)
Nov 1, 2022
beae366
add dhat features to help resolving memory issues (#1829)
Nov 1, 2022
f6f228c
reduce CI bill and improve build speed (#2037)
Nov 1, 2022
d546b57
fix(deps): update all non-major packages >= 1.0
renovate[bot] Nov 1, 2022
796efc8
Exports `Endpoint` struct (#2009)
scottdouglas1989 Nov 2, 2022
06aff46
validate default values for input object fields (#2003)
Nov 2, 2022
c4cce27
reload the configuration when receiving the SIGHUP signal (#2015)
Nov 2, 2022
9b3d35b
chore(deps): update openzipkin/zipkin docker tag to v2.23.19 (#1969)
renovate[bot] Nov 2, 2022
978fa66
apply tower best practices to services when cloning inner services (#…
Nov 2, 2022
2c12546
fix(deps): update dependency @apollo/server to v4.1.0 [security]
renovate[bot] Nov 2, 2022
0ff6a74
remove references to git submodules from DEVELOPMENT.md (#2045)
Nov 3, 2022
b74a894
chore: Remove unused docs infrastructure (#1894)
abernix Nov 3, 2022
62d7452
(fix) #2036 Otel default endpoint incorrectly uses https. (#2048)
BrynCooke Nov 7, 2022
6b42c2a
Update apollo-parser to 0.3 (#2051)
SimonSapin Nov 7, 2022
0b1cb26
apply traffic shaping on subgraph directly (#2034)
Nov 7, 2022
6b2bd9f
docs: add a note about --dev mode config equivalent (#1940)
lennyburdette Nov 7, 2022
46d5199
Update to apollo-smith 0.2 (#2062)
SimonSapin Nov 8, 2022
509e7d1
fix(deps): update all non-major packages >= 1.0
renovate[bot] Nov 8, 2022
ad20599
do not expose the trace_id in response header right now (#2061)
bnjjj Nov 8, 2022
3a7f831
Prepare for v1.3.0 (#2065)
abernix Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ executors:
arm_linux_build: &arm_linux_build_executor
machine:
image: ubuntu-2004:2022.04.1
resource_class: arm.medium
resource_class: arm.large
arm_linux_test: &arm_linux_test_executor
machine:
image: ubuntu-2004:2022.04.1
resource_class: arm.large
resource_class: arm.xlarge
macos_build: &macos_build_executor
macos:
# See https://circleci.com/docs/xcode-policy along with the support matrix
Expand Down Expand Up @@ -231,6 +231,9 @@ commands:
parameters:
os:
type: string
cargo_test_args:
type: string
default: "--"
steps:
- run:
name: Start jaeger
Expand All @@ -245,11 +248,14 @@ commands:
# As of rustc 1.61.0, must limit the number of linux jobs or we run out of memory (large executor/8GB)
- when:
condition:
or:
- equal: [linux_amd, << parameters.os >>]
- equal: [linux_arm, << parameters.os >>]
equal: [linux_amd, << parameters.os >>]
steps:
- run: cargo test --jobs 4 --workspace --locked << parameters.cargo_test_args >> --test-threads=6
- when:
condition:
equal: [linux_arm, << parameters.os >>]
steps:
- run: cargo test --jobs 4 --workspace --locked -- --test-threads=4
- run: cargo test --jobs 8 --workspace --locked << parameters.cargo_test_args >> --test-threads=8
- when:
condition:
equal: [macos, << parameters.os >>]
Expand Down Expand Up @@ -333,6 +339,26 @@ jobs:
- test_workspace:
os: macos

test_updated:
environment:
<<: *common_job_environment
executor: amd_linux_test
steps:
- checkout
- linux_amd_install_baseline
- run:
name: Use latest Rust Nightly and update all Rust dependencies
command: |
sed -i '/channel/d' rust-toolchain.toml
echo 'channel = "nightly"' >> rust-toolchain.toml
rm Cargo.lock
cargo fetch
- test_workspace:
os: linux_amd
# schema_generation test skipped because schemars changed its representation of enums:
# https://github.com/GREsau/schemars/blob/master/CHANGELOG.md#086---2021-09-26
cargo_test_args: --no-fail-fast -- --skip schema_generation

build_release:
parameters:
platform:
Expand Down Expand Up @@ -502,7 +528,12 @@ workflows:
# parameters:
# platform: [linux]

- test_updated:
requires:
- lint
- test:
requires:
- lint
matrix:
parameters:
platform:
Expand Down
117 changes: 117 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,123 @@ 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.3.0] - 2022-11-09

## 🚀 Features

### Add support for DHAT-based heap profiling ([PR #1829](https://github.com/apollographql/router/pull/1829))

The [dhat-rs](https://github.com/nnethercote/dhat-rs) crate provides [DHAT](https://www.valgrind.org/docs/manual/dh-manual.html)-style heap profiling. We have added two compile-time features, `dhat-heap` and `dhat-ad-hoc`, which leverage this ability.

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

### Add `trace_id` in logs to correlate entries from the same request ([Issue #1981](https://github.com/apollographql/router/issues/1981))

A `trace_id` is now added to each log line to help correlate log entries to specific requests. The value for this property will be automatically inherited from any enabled distributed tracing headers, such as those listed in our [Tracing propagation header](https://www.apollographql.com/docs/router/configuration/tracing/#propagation) documentation (e.g., Jaeger, Zipkin, Datadog, etc.).

In the event that a `trace_id` was not inherited from a propagated header, the Router will originate a `trace_id` and propagate that ID to subgraphs if header propagation (see link above) is enabled.

Here is an example of the `trace_id` appearing in plain-text log output:

```
2022-10-21T15:17:45.562553Z ERROR [trace_id=5e6a6bda8d0dca26e5aec14dafa6d96f] apollo_router::services::subgraph_service: fetch_error="hyper::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" }))"
2022-10-21T15:17:45.565768Z ERROR [trace_id=5e6a6bda8d0dca26e5aec14dafa6d96f] apollo_router::query_planner::execution: Fetch error: HTTP fetch failed from 'accounts': HTTP fetch failed from 'accounts': error trying to connect: tcp connect error: Connection refused (os error 111)
```

And an example of the `trace_id` appearing in JSON-formatted log output in a similar scenario:

```json
{"timestamp":"2022-10-26T15:39:01.078260Z","level":"ERROR","fetch_error":"hyper::Error(Connect, ConnectError(\"tcp connect error\", Os { code: 111, kind: ConnectionRefused, message: \"Connection refused\" }))","target":"apollo_router::services::subgraph_service","filename":"apollo-router/src/services/subgraph_service.rs","line_number":182,"span":{"name":"subgraph"},"spans":[{"trace_id":"5e6a6bda8d0dca26e5aec14dafa6d96f","name":"request"},{"name":"supergraph"},{"name":"execution"},{"name":"parallel"},{"name":"fetch"},{"name":"subgraph"}]}
{"timestamp":"2022-10-26T15:39:01.080259Z","level":"ERROR","message":"Fetch error: HTTP fetch failed from 'accounts': HTTP fetch failed from 'accounts': error trying to connect: tcp connect error: Connection refused (os error 111)","target":"apollo_router::query_planner::execution","filename":"apollo-router/src/query_planner/execution.rs","line_number":188,"span":{"name":"parallel"},"spans":[{"trace_id":"5e6a6bda8d0dca26e5aec14dafa6d96f","name":"request"},{"name":"supergraph"},{"name":"execution"},{"name":"parallel"}]}
```

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

### Reload configuration when receiving the SIGHUP signal ([Issue #35](https://github.com/apollographql/router/issues/35))

The Router will now reload its configuration when receiving the SIGHUP signal. This signal is only supported on *nix platforms,
and only when a configuration file was passed to the Router initially at startup.

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

## 🐛 Fixes

### Fix the deduplication logic in deduplication caching ([Issue #1984](https://github.com/apollographql/router/issues/1984))

Under load, we found it was possible to break the router de-duplication logic and leave orphaned entries in the waiter map. This fixes the de-duplication logic to prevent this from occurring.

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

### Follow back-off instructions from Studio Uplink ([Issue #1494](https://github.com/apollographql/router/issues/1494) [Issue #1539](https://github.com/apollographql/router/issues/1539))

When operating in a [Managed Federation configuration](https://www.apollographql.com/docs/federation/managed-federation/overview/) and fetching the supergraph from Apollo Uplink, the Router will now react differently depending on the response from Apollo Uplink, rather than retrying incessantly:

- Not attempt to retry when met with unrecoverable conditions (e.g., a Graph that does not exist).
- Back-off on retries when the infrastructure asks for a longer retry interval.

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

### Fix the rhai SDL `print` function ([Issue #2005](https://github.com/apollographql/router/issues/2005))

Fixes the `print` function exposed to rhai which was broken due to a recent change that was made in the way we pass SDL (schema definition language) to plugins.

By [@fernando-apollo](https://github.com/fernando-apollo) in https://github.com/apollographql/router/pull/2007

### Export `router_factory::Endpoint` ([PR #2007](https://github.com/apollographql/router/pull/2007))

We now export the `router_factory::Endpoint` struct that was inadvertently unexposed. Without access to this struct, it was not possible to implement the `web_endpoints` trait in plugins.

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

### Validate default values for input object fields ([Issue #1979](https://github.com/apollographql/router/issues/1979))

When validating variables, the Router now uses graph-specified default values for object fields, if applicable.

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

### Address regression when sending gRPC to `localhost` ([Issue #2036](https://github.com/apollographql/router/issues/2036))

We again support sending unencrypted gRPC tracing and metrics data to `localhost`. This follows-up on a regression which occurred in the previous release which addressed a limitation which prevented sending gRPC to TLS-secured endpoints.

Applying a proper fix was complicated by an upstream issue ([opentelemetry-rust#908](https://github.com/open-telemetry/opentelemetry-rust/issues/908)) which incorrectly assumes `https` in the absence of a more-specific protocol/schema, contrary to the OpenTelmetry specification which indicates otherwise.

The Router will now detect and work-around this upstream issue by explicitly setting the full, correct endpoint URLs when not specified in config.

In addition:

- Basic TLS-encyrption will be enabled when the endpoint scheme is explicitly `https`.
- A _warning_ will be emitted if the endpoint port is 443 but *no* TLS config is specified since _most_ traffic on port 443 is expected to be encrypted.

By [@bryncooke](https://github.com/bryncooke) in https://github.com/apollographql/router/pull/#2048

## 🛠 Maintenance

### Apply Tower best-practice to "inner" Service cloning ([PR #2030](https://github.com/apollographql/router/pull/2030))

We found our `Service` readiness checks could be improved by following the Tower project's [recommendations](https://docs.rs/tower/latest/tower/trait.Service.html#be-careful-when-cloning-inner-services) for cloning inner Services.

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

### Split the configuration file implementation into modules ([Issue #1790](https://github.com/apollographql/router/issues/1790))

The internals of the implementation for the configuration have been modularized to facilitate on-going development. There should be no impact to end-users who are only using YAML to configure their Router.

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

### Apply traffic-shaping directly to `supergraph` and `subgraph` ([PR #2034](https://github.com/apollographql/router/issues/2034))

The plugin infrastructure works on `BoxService` instances and makes no guarantee on plugin ordering. The traffic shaping plugin needs a clonable inner service, and should run right before calling the underlying service. We'e changed the traffic plugin application so it can work directly on the underlying service. The configuration remains the same since this is still implemented as a plugin.

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

## 📚 Documentation

### Remove references to Git submodules from `DEVELOPMENT.md` ([Issue #2012](https://github.com/apollographql/router/issues/2012))

We've removed the instructions from our development documentation which guide users to familiarize themselves with and clone Git submodules when working on the Router source itself. This follows-up on the removal of the modules themselves in [PR #1856](https://github.com/apollographql/router/pull/1856).

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

# [1.2.1] - 2022-10-25

## 🐛 Fixes
Expand Down
Loading