Skip to content

Commit

Permalink
release: v1.48.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal authored Jun 3, 2024
2 parents 97e7605 + f6e95fc commit 6ad357e
Show file tree
Hide file tree
Showing 430 changed files with 16,394 additions and 1,214 deletions.
Empty file.
14 changes: 4 additions & 10 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final-status-level = "skip"
# Do not cancel the test run on the first failure.
fail-fast = false

# Most tests should take much less than 2 minute (see override below)
# Each test should take much less than 2 minute
slow-timeout = { period = "30s", terminate-after = 4 }

# Write to output for persistence to CircleCI
Expand All @@ -19,12 +19,6 @@ path = "junit.xml"
# Integration tests require more than one thread. The default setting of 1 will cause too many integration tests to run
# at the same time and causes tests to fail where timing is involved.
# This filter applies only to to the integration tests in the apollo-router package.
[[profile.default.overrides]]
filter = 'package(apollo-router) & kind(test)'
threads-required = 2

# Scaffold test takes all the test threads as it runs rustc, and takes more time.
[[profile.default.overrides]]
filter = 'package(apollo-router-scaffold)'
threads-required = 'num-test-threads'
slow-timeout = { period = "60s", terminate-after = 10 }
[[profile.ci.overrides]]
filter = 'test(/^apollo-router::/)'
threads-required = 4
210 changes: 210 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,216 @@ 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.48.0] - 2024-05-29

## 🚀 Features

### Demand control preview ([PR #5317](https://github.com/apollographql/router/pull/5317))

> ⚠️ This is a preview for 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 with a [free Enterprise trial](https://studio.apollographql.com/signup?type=enterprise-trial).
>
> As a preview feature, it's subject to our [Preview launch stage](https://www.apollographql.com/docs/resources/product-launch-stages/#preview) expectations and configuration and performance may change in future releases.

Demand control allows you to control the cost of operations in the router, potentially rejecting requests that are too expensive that could bring down the Router or subgraphs.

```yaml
# Demand control enabled, but in measure mode.
preview_demand_control:
enabled: true
# `measure` or `enforce` mode. Measure mode will analyze cost of operations but not reject them.
mode: measure

strategy:
# Static estimated strategy has a fixed cost for elements and when set to enforce will reject
# requests that are estimated as too high before any execution takes place.
static_estimated:
# The assumed returned list size for operations. This should be set to the maximum number of items in graphql list
list_size: 10
# The maximum cost of a single operation.
max: 1000
```

Telemetry is emitted for demand control, including the estimated cost of operations and whether they were rejected or not.
Full details will be included in the documentation for demand control which will be finalized before the next release.

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

### Ability to include Apollo Studio trace ID on tracing spans ([Issue #3803](https://github.com/apollographql/router/issues/3803)), ([Issue #5172](https://github.com/apollographql/router/issues/5172))

Add support for a new trace ID selector kind, the `apollo` trace ID, which represents the trace ID on [Apollo GraphOS Studio](https://studio.apollographql.com/).

An example configuration using `trace_id: apollo`:

```yaml
telemetry:
instrumentation:
spans:
router:
"studio.trace.id":
trace_id: apollo
```


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

### Add ability for router to deal with query plans with contextual rewrites ([PR #5097](https://github.com/apollographql/router/pull/5097))

Adds the ability for the router to execute query plans with context rewrites. A context is generated by the `@fromContext` directive, and each context maps values in the collected data JSON onto a variable that's used as an argument to a field resolver. To learn more, see [Saving and referencing data with contexts](https://www.apollographql.com/docs/federation/federated-types/federated-directives#saving-and-referencing-data-with-contexts).

⚠️ Because this feature requires a new version of federation, v2.8.0, distributed caches will need to be repopulated.

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

## 🐛 Fixes

### Fix custom attributes for spans and histogram when used with `response_event` ([PR #5221](https://github.com/apollographql/router/pull/5221))

This release fixes multiple issues related to spans and selectors:

- Custom attributes based on response_event in spans are properly added.
- Histograms using response_event selectors are properly updated.
- Static selectors that set a static value are now able to take a Value.
- Static selectors that set a static value are now set at every stage.
- The `on_graphql_error` selector is available on the supergraph stage.
- The status of a span can be overridden with the `otel.status_code` attribute.

As an example of using these fixes, the configuration below uses spans with static selectors to mark spans as errors when GraphQL errors occur:

```yaml
telemetry:
instrumentation:
spans:
router:
attributes:
otel.status_code:
static: error
condition:
eq:
- true
- on_graphql_error: true
supergraph:
attributes:
otel.status_code:
static: error
condition:
eq:
- true
- on_graphql_error: true
```

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

### Fix instrument incrementing on aborted request when condition is not fulfilled ([PR #5215](https://github.com/apollographql/router/pull/5215))

Previously when a telemetry instrument was dropped it would be incremented even if the associated condition was not fulfilled. For instance:

```yaml
telemetry:
instrumentation:
instruments:
router:
http.server.active_requests: false
http.server.request.duration: false
"custom_counter":
description: "count of requests"
type: counter
unit: "unit"
value: unit
# This instrument should not be triggered as the condition is never true
condition:
eq:
- response_header: "never-received"
- static: "true"
```

In the case where a request was started, but the client aborted the request before the response was sent, the `response_header` would never be set to `"never-received"`,
and the instrument would not be triggered. However, the instrument would still be incremented.

Conditions are now checked for aborted requests, and the instrument is only incremented if the condition is fulfilled.

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

## 🛠 Maintenance

### Send query planner and lifecycle metrics to Apollo ([PR #5267](https://github.com/apollographql/router/pull/5267), [PR #5270](https://github.com/apollographql/router/pull/5270))

To enable the performance measurement of the router's new query planner implementation, the router transmits to Apollo the following new metrics:
- `apollo.router.query_planning.*` provides metrics on the query planner that help improve the query planning implementation.
- `apollo.router.lifecycle.api_schema` provides feedback on the experimental Rust-based API schema generation.
- `apollo.router.lifecycle.license` provides metrics on license expiration that help improve the reliability of the license check mechanism.

These metrics don't leak any sensitive data.

By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/5267, [@goto-bus-stop](https://github.com/goto-bus-stop)

## 📚 Documentation

### Add Rhai API constants reference

The Rhai API documentation now includes [a list of available constants](https://www.apollographql.com/docs/router/customizations/rhai-api/#available-constants) that are available in the Rhai runtime.

By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/5189
## 🧪 Experimental

### GraphQL instruments ([PR #5215](https://github.com/apollographql/router/pull/5215), [PR #5257](https://github.com/apollographql/router/pull/5257))

This PR adds experimental GraphQL instruments to telemetry.

The new instruments are configured in the following:
```
telemetry:
instrumentation:
instruments:
graphql:
# The number of times a field was executed (counter)
field.execution: true

# The length of list fields (histogram)
list.length: true

# Custom counter of field execution where field name = name
"custom_counter":
description: "count of name field"
type: counter
unit: "unit"
value: field_unit
attributes:
graphql.type.name: true
graphql.field.type: true
graphql.field.name: true
condition:
eq:
- field_name: string
- "name"

# Custom histogram of list lengths for topProducts
"custom_histogram":
description: "histogram of review length"
type: histogram
unit: "unit"
attributes:
graphql.type.name: true
graphql.field.type: true
graphql.field.name: true
value:
field_custom:
list_length: value
condition:
eq:
- field_name: string
- "topProducts"
```

Using the new instruments consumes significant performance resources from the router. Their performance will be improved in a future release.

Large numbers of metrics may also be generated by using the instruments, so make sure to not incur excessively large APM costs.

⚠ Use these instruments only in development. Don't use them in production.

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



# [1.47.0] - 2024-05-21

## 🚀 Features
Expand Down
Loading

0 comments on commit 6ad357e

Please sign in to comment.