Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prep release: v1.46.0 #5099

Merged
merged 1 commit into from
May 7, 2024
Merged

prep release: v1.46.0 #5099

merged 1 commit into from
May 7, 2024

Conversation

BrynCooke
Copy link
Contributor

Note

When approved, this PR will merge into the 1.46.0 branch which will — upon being approved itself — merge into main.

Things to review in this PR:

  • Changelog correctness (There is a preview below, but it is not necessarily the most up to date. See the Files Changed for the true reality.)
  • Version bumps
  • That it targets the right release branch (1.46.0 in this case!).

🚀 Features

Entity cache preview: support queries with private scope (PR #4855)

This feature is part of the work on subgraph entity caching, currently in preview.

The router now supports caching responses marked with private scope. This caching currently works only on subgraph responses without any schema-level information.

For details about the caching behavior, see PR #4855

By @Geal in #4855

Add support of custom events defined by YAML for telemetry (Issue #4320)

Users can now configure telemetry events via YAML.
to log that something has happened (e.g. a request had errors of a particular type) without reaching for Rhai or a custom plugin.

Events may be triggered on conditions and can include information in the request/response pipeline as attributes.

Here is an example of configuration:

telemetry:
  instrumentation:
    events:
      router:
        # Standard events
        request: info
        response: info
        error: info

        # Custom events
        my.event:
          message: "my event message"
          level: info
          on: request
          attributes:
            http.response.body.size: false
          # Only log when the x-log-request header is `log` 
          condition:
            eq:
              - "log"
              - request_header: "x-log-request"
          
      supergraph:
          # Custom event configuration for supergraph service ...
      subgraph:
          # Custom event configuration for subgraph service .

By @bnjjj in #4956

Ability to ignore auth prefixes in the JWT plugin

The router now supports a configuration to ignore header prefixes with the JWT plugin. Given that many application headers use the format of Authorization: <scheme> <token>, this option enables the router to process requests for specific schemes within the Authorization header while ignoring others.

For example, you can configure the router to process requests with Authorization: Bearer <token> defined while ignoring others such as Authorization: Basic <token>:

authentication:
  router:
    jwt:
      header_name: authorization
      header_value_prefix: "Bearer"
      ignore_mismatched_prefix: true

If the header prefix is an empty string, this option is ignored.

By @lleadbet in #4718

Support conditions on custom attributes for spans and a new selector for GraphQL errors (Issue #4336)

The router now supports conditionally adding attributes on a span and the new on_graphql_error selector that is set to true if the response body contains GraphQL errors.

An example configuration using condition in attributes and on_graphql_error:

telemetry:
  instrumentation:
    spans: 
      router: 
        attributes:    
          otel.status_description: 
            static: "there was an error"
            condition:
              any:
              - not:
                  eq:
                  - response_status: code
                  - 200
              - eq:
                - on_graphql_error
                - true

By @bnjjj in #4987

🐛 Fixes

Federation v2.7.5 (PR #5064)

This brings in a query planner fix released in v2.7.5 of Apollo Federation. Notably, from its changelog:

  • Fix issue with missing fragment definitions due to generateQueryFragments. (#2993)

    An incorrect implementation detail in generateQueryFragments caused certain queries to be missing fragment definitions, causing the operation to be invalid and fail early in the request life-cycle (before execution). Specifically, subsequent fragment "candidates" with the same type condition and the same length of selections as a previous fragment weren't correctly added to the list of fragments. An example of an affected query is:

    query {
      t {
        ... on A {
          x
          y
        }
      }
      t2 {
        ... on A {
          y
          z
        }
      }
    }

    In this case, the second selection set would be converted to an inline fragment spread to subgraph fetches, but the fragment definition would be missing
    By @garypen in Update the version of the router-bridge #5064

Use supergraph schema to extract authorization info (PR #5047)

The router now uses the supergraph schema to extract authorization info, as authorization information may not be available on the query planner's subgraph schemas. This reverts the authorization changes made in PR #4975.

By @tninesling in #5047

Filter fetches added to batch during batch creation (PR #5034)

Previously, the router didn't filter query hashes when creating batches. This could result in failed queries because the additional hashes could incorrectly make a query appear to be committed when it wasn't actually registered in a batch.

This release fixes this issue by filtering query hashes during batch creation.

By @garypen in #5034

Use subgraph.name attribute instead of apollo.subgraph.name (PR #5012)

In the router v1.45.0, subgraph name mapping didn't work correctly in the Datadog exporter.

The Datadog exporter does some explicit mapping of attributes and was using a value apollo.subgraph.name that the latest versions of the router don't use. The correct choice is subgraph.name.

This release updates the mapping to reflect the change and fixes subgraph name mapping for Datadog.

By @garypen in #5012

📚 Documentation

Document traffic shaping default configuration (PR #4953)

The documentation for configuring traffic shaping has been updated to clarify that it's enabled by default with preset values. This setting has been the default since PR #3330, which landed in v1.23.0.

By @bnjjj in #4953

🧪 Experimental

Experimental type conditioned fetching (PR #4748)

This release introduces an experimental configuration to enable type-conditioned fetching.

Previously, when querying a field that was in a path of two or more unions, the query planner wasn't able to handle different selections and would aggressively collapse selections in fetches. This resulted in incorrect plans.

Enabling the experimental_type_conditioned_fetching option can fix this issue by configuring the query planner to fetch with type conditions.

experimental_type_conditioned_fetching: true # false by default

By @o0Ignition0o in #4748

@router-perf
Copy link

router-perf bot commented May 7, 2024

CI performance tests

  • step - Basic stress test that steps up the number of users over time
  • events_big_cap_high_rate_callback - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity using callback mode
  • large-request - Stress test with a 1 MB request payload
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • xxlarge-request - Stress test with 100 MB request payload
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • xlarge-request - Stress test with 10 MB request payload
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • events_callback - Stress test for events with a lot of users and deduplication ENABLED in callback mode
  • no-graphos - Basic stress test, no GraphOS.
  • reload - Reload test over a long period of time at a constant rate of users
  • events_big_cap_high_rate - Stress test for events with a lot of users, deduplication enabled and high rate event with a big queue capacity
  • events_without_dedup_callback - Stress test for events with a lot of users and deduplication DISABLED using callback mode
  • const - Basic stress test that runs with a constant number of users

Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read my comment and fix the period after the merge. 😄

CHANGELOG.md Show resolved Hide resolved
@BrynCooke BrynCooke merged commit a36c6e1 into 1.46.0 May 7, 2024
11 of 13 checks passed
@BrynCooke BrynCooke deleted the prep-1.46.0 branch May 7, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants