Skip to content

Commit

Permalink
1.59.0 reconcile
Browse files Browse the repository at this point in the history
  • Loading branch information
bryn committed Dec 17, 2024
2 parents 3bdcacd + a12d988 commit 0e74f19
Show file tree
Hide file tree
Showing 230 changed files with 5,429 additions and 7,110 deletions.
34 changes: 34 additions & 0 deletions .changesets/fix_bryn_datadog_agent_sampling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
### Enable accurate Datadog APM metrics ([PR #6017](https://github.com/apollographql/router/pull/6017))

The router supports a new preview feature, the `preview_datadog_agent_sampling` option, to enable sending all spans to the Datadog Agent so APM metrics and views are accurate.

Previously, the sampler option in `telemetry.exporters.tracing.common.sampler` wasn't Datadog-aware. To get accurate Datadog APM metrics, all spans must be sent to the Datadog Agent with a `psr` or `sampling.priority` attribute set appropriately to record the sampling decision.

The `preview_datadog_agent_sampling` option enables accurate Datadog APM metrics. It should be used when exporting to the Datadog Agent, via OTLP or Datadog-native.

```yaml
telemetry:
exporters:
tracing:
common:
# Only 10 percent of spans will be forwarded from the Datadog agent to Datadog. Experiment to find a value that is good for you!
sampler: 0.1
# Send all spans to the Datadog agent.
preview_datadog_agent_sampling: true


```

Using these options can decrease your Datadog bill, because you will be sending only a percentage of spans from the Datadog Agent to Datadog.

> [!IMPORTANT]
> Users must enable `preview_datadog_agent_sampling` to get accurate APM metrics. Users that have been using recent versions of the router will have to modify their configuration to retain full APM metrics.
> [!IMPORTANT]
> The router doesn't support [`in-agent` ingestion control](https://docs.datadoghq.com/tracing/trace_pipeline/ingestion_mechanisms/?tab=java#in-the-agent).
> Configuring `traces_per_second` in the Datadog Agent won't dynamically adjust the router's sampling rate to meet the target rate.
> [!IMPORTANT]
> Sending all spans to the Datadog Agent may require that you tweak the `batch_processor` settings in your exporter config. This applies to both OTLP and Datadog native exporters.
Learn more by reading the [updated Datadog tracing documentation](https://apollographql.com/docs/router/configuration/telemetry/exporters/tracing/datadog) for more information on configuration options and their implications.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
### Fix transmitted header value for Datadog priority sampling resolution ([PR #6017](https://github.com/apollographql/router/pull/6017))

The router now transmits correct values of `x-datadog-sampling-priority` to downstream services.

Previously, an `x-datadog-sampling-priority` of `-1` was incorrectly converted to `0` for downstream requests, and `2` was incorrectly converted to `1`. When propagating to downstream services, this resulted in values of `USER_REJECT` being incorrectly transmitted as `AUTO_REJECT`.

10 changes: 10 additions & 0 deletions .changesets/fix_fix_invalid_error_path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Truncating Invalid Error Paths ([PR #6359](https://github.com/apollographql/router/pull/6359))

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

According to the [GraphQL Specification](https://spec.graphql.org/draft/#sel-GAPHRPHCAACCpC8-T) 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.
If a subgraph error includes a path that can't be matched to a response field, the router now truncates the path to the nearest valid field path.

By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/6359
11 changes: 11 additions & 0 deletions .changesets/maint_simon_unbridge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Remove the legacy query planner ([PR #6418](https://github.com/apollographql/router/pull/6418))

The legacy query planner has been removed in this release. In the previous release, Router 1.58, it was already no longer used by default but it 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](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/6418
34 changes: 1 addition & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ parameters:
protoc_version:
type: string
default: "21.8"
# note the cmake version is only used for manual installs, not for installs from a package manager like apt or homebrew
cmake_version:
type: string
default: "3.31.1"
nightly:
type: boolean
default: false
Expand Down Expand Up @@ -237,37 +233,9 @@ commands:
command: |
if [[ ! -d "$HOME/.deb" ]]; then
mkdir $HOME/.deb
sudo apt-get --download-only -o Dir::Cache="$HOME/.deb" -o Dir::Cache::archives="$HOME/.deb" install libssl-dev libdw-dev cmake
sudo apt-get --download-only -o Dir::Cache="$HOME/.deb" -o Dir::Cache::archives="$HOME/.deb" install libssl-dev libdw-dev
fi
sudo dpkg -i $HOME/.deb/*.deb
- when:
condition:
or:
- equal: [ *windows_build_executor, << parameters.platform >> ]
- equal: [ *windows_test_executor, << parameters.platform >> ]
steps:
- run:
name: Install CMake
command: |
mkdir -p "$HOME/.local"
if [[ ! -f "$HOME/.local/bin/cmake" ]]; then
curl -L https://github.com/Kitware/CMake/releases/download/v<< pipeline.parameters.cmake_version >>/cmake-<< pipeline.parameters.cmake_version >>-windows-x86_64.zip --output cmake.zip
# The zip file has a root directory, so we put it somewhere else first before placing the files in .local
unzip cmake.zip -d /tmp > /dev/null
cp /tmp/cmake-<< pipeline.parameters.cmake_version >>-windows-x86_64/* -R "$HOME/.local"
fi
cmake --version
- when:
condition:
or:
- equal: [ *macos_build_executor, << parameters.platform >> ]
- equal: [ *macos_test_executor, << parameters.platform >> ]
steps:
- run:
name: Install CMake
command: |
brew install cmake
install_protoc:
parameters:
platform:
Expand Down
1 change: 0 additions & 1 deletion .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::en
or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::query_planner_redis_update_defer) )
or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::query_planner_redis_update_introspection) )
or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::query_planner_redis_update_query_fragments) )
or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::query_planner_redis_update_reuse_query_fragments) )
or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::query_planner_redis_update_type_conditional_fetching) )
or ( binary_id(=apollo-router::integration_tests) & test(=integration::redis::test::connection_failure_blocks_startup) )
or ( binary_id(=apollo-router::integration_tests) & test(=integration::subgraph_response::test_invalid_error_locations_contains_negative_one_location) )
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ Refer to [the README file](README.md) or run `cargo run --help` for more informa

- `crates/apollo-router/src/main.rs`: the entry point for the executable

Some of the functionalities rely on the current Javascript / TypeScript implementation, provided by [apollo federation](https://github.com/apollographql/federation), which is exposed through the [federation router-bridge](https://github.com/apollographql/federation/tree/main/router-bridge).

## Documentation

Documentation for using and contributing to the Apollo Router Core is built using Gatsby
Expand Down
Loading

0 comments on commit 0e74f19

Please sign in to comment.