Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
102 changes: 102 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,39 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/

# [x.x.x] (unreleased) - 2022-mm-dd
## ❗ BREAKING ❗
### Fix naming inconsistency of telemetry.metrics.common.attributes.router ([Issue #2076](https://github.com/apollographql/router/issues/2076))

Mirroring the rest of the config `router` should be `supergraph`

```yaml
telemetry:
metrics:
common:
attributes:
router: # old
```
becomes
```yaml
telemetry:
metrics:
common:
attributes:
supergraph: # new
```

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

### CLI structure changes ([Issue #2123](https://github.com/apollographql/router/issues/2123))

As the Router gains functionality the limitations of the current CLI structure are becoming apparent.

There is now a separate subcommand for config related operations:
* `config`
* `schema` - Output the configuration schema
* `upgrade` - Upgrade the configuration with optional diff support.

`router --schema` has been deprecated and users should move to `router config schema`.

## 🚀 Features

### Provide multi-arch (amd64/arm64) Docker images for the Router ([Issue #1932](https://github.com/apollographql/router/pull/2138))
Expand Down Expand Up @@ -64,6 +97,43 @@ helm upgrade --install --create-namespace --namespace router-test --set-file sup

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

### Configuration upgrades ([Issue #2123](https://github.com/apollographql/router/issues/2123))

Occasionally we will make changes to the Router yaml configuration format.
When starting the Router if the configuration can be upgraded it will do so automatically and display a warning:

```
2022-11-22T14:01:46.884897Z WARN router configuration contains deprecated options:

1. telemetry.tracing.trace_config.attributes.router has been renamed to 'supergraph' for consistency

These will become errors in the future. Run `router config upgrade <path_to_router.yaml>` to see a suggested upgraded configuration.
```

Note: If a configuration has errors after upgrading then the configuration will not be upgraded automatically.

From the CLI users can run:
* `router config upgrade <path_to_router.yaml>` to output configuration that has been upgraded to match the latest config format.
* `router config upgrade --diff <path_to_router.yaml>` to output a diff e.g.
```
telemetry:
apollo:
client_name_header: apollographql-client-name
metrics:
common:
attributes:
- router:
+ supergraph:
request:
header:
- named: "1" # foo
```

There are situations where comments and whitespace are not preserved. This may be improved in future.

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


## 🐛 Fixes

### Improve errors when subgraph returns non-GraphQL response with a non-2xx status code ([Issue #2117](https://github.com/apollographql/router/issues/2117))
Expand Down
37 changes: 33 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,40 @@ specified via flag, either by an absolute path, or a path relative to the curren
directory.

```
USAGE:
router [OPTIONS] [SUBCOMMAND]

OPTIONS:
-c, --config <configuration-path> Configuration file location
-s, --supergraph <supergraph-path> Supergraph Schema location
--hr, --hot-reload Watches for changes in the supergraph and configuration file
--schema Prints out a JSON schema of the configuration file
--apollo-uplink-endpoints <APOLLO_UPLINK_ENDPOINTS>
The endpoints (comma separated) polled to fetch the latest supergraph schema [env:
APOLLO_UPLINK_ENDPOINTS=]

--apollo-uplink-poll-interval <APOLLO_UPLINK_POLL_INTERVAL>
The time between polls to Apollo uplink. Minimum 10s [env: APOLLO_UPLINK_POLL_INTERVAL=]
[default: 10s]

-c, --config <CONFIG_PATH>
Configuration location relative to the project directory [env:
APOLLO_ROUTER_CONFIG_PATH=]

-h, --help
Print help information

--hot-reload
Reload configuration and schema files automatically [env: APOLLO_ROUTER_HOT_RELOAD=]

--log <LOG_LEVEL>
Log level (off|error|warn|info|debug|trace) [env: APOLLO_ROUTER_LOG=] [default: info]

-s, --supergraph <SUPERGRAPH_PATH>
Schema location relative to the project directory [env: APOLLO_ROUTER_SUPERGRAPH_PATH=]

-V, --version
Display version and exit

SUBCOMMANDS:
config Configuration subcommands
help Print this message or the help of the given subcommand(s)
```

## Who is Apollo?
Expand Down
6 changes: 4 additions & 2 deletions apollo-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ derive_more = { version = "0.99.17", default-features = false, features = [
"display",
] }
dhat = { version = "0.3.2", optional = true }
diff = "0.1.13"
directories = "4.0.1"
displaydoc = "0.2"
flate2 = "1.0.24"
Expand All @@ -84,6 +85,7 @@ hyper = { version = "0.14.23", features = ["server", "client"] }
hyper-rustls = { version = "0.23.1", features = ["http1", "http2"] }
indexmap = { version = "1.9.2", features = ["serde-1"] }
itertools = "0.10.5"
jsonpath_lib = "0.3.0"
jsonschema = { version = "0.16.1", default-features = false }
lazy_static = "1.4.0"
libc = "0.2.137"
Expand Down Expand Up @@ -140,6 +142,7 @@ pin-project-lite = "0.2.9"
prometheus = "0.13"
prost = "0.9.0"
prost-types = "0.9.0"
proteus = "0.5.0"
rand = "0.8.5"
rhai = { version = "1.11.0", features = ["sync", "serde", "internals"] }
redis = { version = "0.21.6", optional = true, features = ["cluster", "tokio-comp"] }
Expand All @@ -151,6 +154,7 @@ reqwest = { version = "0.11.13", default-features = false, features = [
"stream",
] }
router-bridge = "0.1.11"
rust-embed="6.4.2"
schemars = { version = "0.8.11", features = ["url"] }
shellexpand = "2.1.2"
sha2 = "0.10.6"
Expand Down Expand Up @@ -193,7 +197,6 @@ tracing-core = "=0.1.26"
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-opentelemetry = "0.17.4"
tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] }

url = { version = "2.3.1", features = ["serde"] }
urlencoding = "2.1.2"
uuid = { version = "1.2.2", features = ["serde", "v4"] }
Expand All @@ -209,7 +212,6 @@ uname = "0.1.1"
[dev-dependencies]
insta = { version = "1.21.1", features = ["json", "redactions"] }
introspector-gadget = "0.1.0"
jsonpath_lib = "0.3.0"
maplit = "1.0.2"
memchr = { version = "2.5.0", default-features = false }
mockall = "0.11.3"
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/configuration/expansion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ impl Expansion {

pub(crate) fn expand_env_variables(
configuration: &serde_json::Value,
expansion: Expansion,
expansion: &Expansion,
) -> Result<serde_json::Value, ConfigurationError> {
let mut configuration = configuration.clone();
visit(&mut configuration, &expansion)?;
visit(&mut configuration, expansion)?;
Ok(configuration)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: telemetry.tracing.trace_config.attributes.router has been renamed to 'supergraph' for consistency
actions:
- type: move
from: telemetry.metrics.common.attributes.router
to: telemetry.metrics.common.attributes.supergraph

Loading