Skip to content

Commit

Permalink
Reconcile dev after merge to main for v1.59.1 (#6522)
Browse files Browse the repository at this point in the history
  • Loading branch information
abernix authored Jan 8, 2025
2 parents c5ee35f + fc75259 commit 4dd7df8
Show file tree
Hide file tree
Showing 20 changed files with 134 additions and 82 deletions.
34 changes: 0 additions & 34 deletions .changesets/fix_bryn_datadog_agent_sampling.md

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions .changesets/fix_bryn_parent_based_sampling_fix_with_fix.md

This file was deleted.

58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,64 @@ 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.59.1] - 2025-01-08

## 🐛 Fixes

### 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`.

### 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.
> - 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.
> - 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.

### Fix non-parent sampling ([PR #6481](https://github.com/apollographql/router/pull/6481))

When the user specifies a non-parent sampler the router should ignore the information from upstream and use its own sampling rate.

The following configuration would not work correctly:

```
exporters:
tracing:
common:
service_name: router
sampler: 0.00001
parent_based_sampler: false
```
All spans are being sampled.
This is now fixed and the router will correctly ignore any upstream sampling decision.

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

# [1.59.0] - 2024-12-17

> [!IMPORTANT]
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ dependencies = [

[[package]]
name = "apollo-federation"
version = "1.59.0"
version = "1.59.1"
dependencies = [
"apollo-compiler",
"derive_more",
Expand Down Expand Up @@ -256,7 +256,7 @@ dependencies = [

[[package]]
name = "apollo-router"
version = "1.59.0"
version = "1.59.1"
dependencies = [
"access-json",
"ahash",
Expand Down Expand Up @@ -423,7 +423,7 @@ dependencies = [

[[package]]
name = "apollo-router-benchmarks"
version = "1.59.0"
version = "1.59.1"
dependencies = [
"apollo-parser",
"apollo-router",
Expand All @@ -439,7 +439,7 @@ dependencies = [

[[package]]
name = "apollo-router-scaffold"
version = "1.59.0"
version = "1.59.1"
dependencies = [
"anyhow",
"cargo-scaffold",
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.59.0"
version = "1.59.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.59.0"
version = "1.59.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.59.0"
version = "1.59.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.template.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.59.0"
apollo-router = "1.59.1"
{{/if}}
{{/if}}
async-trait = "0.1.52"
Expand Down
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.59.0" }
apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.59.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.59.0"
version = "1.59.1"
authors = ["Apollo Graph, Inc. <[email protected]>"]
repository = "https://github.com/apollographql/router/"
documentation = "https://docs.rs/apollo-router"
Expand Down Expand Up @@ -59,7 +59,7 @@ ci = []
access-json = "0.1.0"
anyhow = "1.0.86"
apollo-compiler.workspace = true
apollo-federation = { path = "../apollo-federation", version = "=1.59.0" }
apollo-federation = { path = "../apollo-federation", version = "=1.59.1" }
arc-swap = "1.6.0"
async-channel = "1.9.0"
async-compression = { version = "0.4.6", features = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,50 @@ async fn reports_evaluated_plans() {
router.graceful_shutdown().await;
}

#[tokio::test(flavor = "multi_thread")]
async fn does_not_exceed_max_evaluated_plans_legacy() {
let mut router = IntegrationTest::builder()
.config(
r#"
experimental_query_planner_mode: legacy
telemetry:
exporters:
metrics:
prometheus:
enabled: true
supergraph:
query_planning:
experimental_plans_limit: 4
"#,
)
.supergraph("tests/integration/fixtures/query_planner_max_evaluated_plans.graphql")
.build()
.await;
router.start().await;
router.assert_started().await;
router
.execute_query(
Query::builder()
.body(json!({
"query": r#"{ t { v1 v2 v3 v4 } }"#,
"variables": {},
}))
.build(),
)
.await;

let metrics = router
.get_metrics_response()
.await
.expect("failed to fetch metrics")
.text()
.await
.expect("metrics are not text?!");
assert_evaluated_plans(&metrics, 4);

router.graceful_shutdown().await;
}

#[tokio::test(flavor = "multi_thread")]
async fn does_not_exceed_max_evaluated_plans() {
let mut router = IntegrationTest::builder()
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tracing/docker-compose.datadog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:

apollo-router:
container_name: apollo-router
image: ghcr.io/apollographql/router:v1.59.0
image: ghcr.io/apollographql/router:v1.59.1
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/datadog.router.yaml:/etc/config/configuration.yaml
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tracing/docker-compose.jaeger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
apollo-router:
container_name: apollo-router
#build: ./router
image: ghcr.io/apollographql/router:v1.59.0
image: ghcr.io/apollographql/router:v1.59.1
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/jaeger.router.yaml:/etc/config/configuration.yaml
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/tracing/docker-compose.zipkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
apollo-router:
container_name: apollo-router
build: ./router
image: ghcr.io/apollographql/router:v1.59.0
image: ghcr.io/apollographql/router:v1.59.1
volumes:
- ./supergraph.graphql:/etc/config/supergraph.graphql
- ./router/zipkin.router.yaml:/etc/config/configuration.yaml
Expand Down
12 changes: 10 additions & 2 deletions docs/source/routing/security/jwt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,16 @@ If you _do_ need to pass entire JWTs to subgraphs, you can do so via the GraphOS

If your router enables [tracing](/router/configuration/telemetry/exporters/tracing/overview), the JWT authentication plugin has its own tracing span: `authentication_plugin`

If your router enables [metrics collection via Prometheus](/router/configuration/telemetry/exporters/metrics/prometheus), the JWT authentication plugin provides and exports the following metrics:
If your router [exports metrics](/router/configuration/telemetry/exporters/metrics), the JWT authentication plugin exports the `apollo.router.operations.authentication.jwt` metric. You can use the metric's `authentication.jwt.failed` attribute to count failed authentications. If the `authentication.jwt.failed` attribute is absent or `false`, the authentication succeeded.

<Note>

Before [v1.59.0](https://github.com/apollographql/router/releases/tag/v1.59.0), the JWT authentication exported the following metrics:

- `apollo_authentication_failure_count`
- `apollo_authentication_success_count`

Those metrics have the following shapes:
These metrics have the following shapes:

```
# HELP apollo_authentication_failure_count apollo_authentication_failure_count
Expand All @@ -762,6 +766,10 @@ apollo_authentication_failure_count{kind="JWT",service_name="apollo-router"} 1
apollo_authentication_success_count{kind="JWT",service_name="apollo-router"} 11
```

These metrics are [deprecated](graphos/reference/router/telemetry/instrumentation/standard-instruments#deprecated). Please update to the most recent router version to use the updated `apollo.router.operations.authentication.jwt` metric.

</Note>

## Additional resources

You can use the Apollo Solutions [router JWKS generator](https://github.com/apollosolutions/router-jwks-generator) to create a router configuration file for use with the authentication plugin.
Expand Down
4 changes: 2 additions & 2 deletions helm/chart/router/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ type: application
# so it matches the shape of our release process and release automation.
# By proxy of that decision, this version uses SemVer 2.0.0, though the prefix
# of "v" is not included.
version: 1.59.0
version: 1.59.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v1.59.0"
appVersion: "v1.59.1"
8 changes: 4 additions & 4 deletions helm/chart/router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[router](https://github.com/apollographql/router) Rust Graph Routing runtime for Apollo Federation

![Version: 1.59.0](https://img.shields.io/badge/Version-1.59.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.59.0](https://img.shields.io/badge/AppVersion-v1.59.0-informational?style=flat-square)
![Version: 1.59.1](https://img.shields.io/badge/Version-1.59.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.59.1](https://img.shields.io/badge/AppVersion-v1.59.1-informational?style=flat-square)

## Prerequisites

Expand All @@ -11,15 +11,15 @@
## Get Repo Info

```console
helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.59.0
helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.59.1
```

## Install Chart

**Important:** only helm3 is supported

```console
helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.59.0 --values my-values.yaml
helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.59.1 --values my-values.yaml
```

_See [configuration](#configuration) below._
Expand Down Expand Up @@ -98,4 +98,4 @@ helm show values oci://ghcr.io/apollographql/helm-charts/router
| virtualservice.enabled | bool | `false` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
2 changes: 1 addition & 1 deletion licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -6122,7 +6122,6 @@ <h4>Used by:</h4>
<li><a href=" https://github.com/dtolnay/erased-serde ">erased-serde</a></li>
<li><a href=" https://github.com/dtolnay/ghost ">ghost</a></li>
<li><a href=" https://github.com/dtolnay/itoa ">itoa</a></li>
<li><a href=" https://github.com/rust-lang/libc ">libc</a></li>
<li><a href=" https://github.com/dtolnay/linkme ">linkme</a></li>
<li><a href=" https://github.com/dtolnay/paste ">paste</a></li>
<li><a href=" https://github.com/dtolnay/prettyplease ">prettyplease</a></li>
Expand Down Expand Up @@ -12605,6 +12604,7 @@ <h4>Used by:</h4>
<li><a href=" https://github.com/graphql-rust/graphql-client ">graphql_query_derive</a></li>
<li><a href=" https://gitlab.com/kornelski/http-serde ">http-serde</a></li>
<li><a href=" https://github.com/TedDriggs/ident_case ">ident_case</a></li>
<li><a href=" https://github.com/rust-lang/libc ">libc</a></li>
<li><a href=" https://github.com/alexcrichton/ssh2-rs ">libssh2-sys</a></li>
<li><a href=" https://github.com/dtolnay/linkme ">linkme-impl</a></li>
<li><a href=" https://github.com/stainless-steel/md5 ">md5</a></li>
Expand Down
Loading

0 comments on commit 4dd7df8

Please sign in to comment.