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

chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 17, 2023

This PR contains the following updates:

Package Update Change
ghcr.io/apollographql/router minor v1.32.0 -> v1.54.0

Release Notes

apollographql/router (ghcr.io/apollographql/router)

v1.54.0

Compare Source

🚀 Features

Add configurability of span attributes in logs (Issue #​5540)

The router supports a new telemetry.exporters.logging.stdout.format.json.span_attributes option that enables you to choose a subset of all span attributes to display in your logs.

When span_attributes is specified, the router searches for the first attribute in its input list of span attributes from the root span to the current span and attaches it to the outermost JSON object for the log event. If you set the same attribute name for different spans at different levels, the router chooses the attributes of child spans before the attributes of parent spans.

For example, if you have spans that contains span_attr_1 attribute and you only want to display this span attribute:

telemetry:
  exporters:
     logging:
       stdout:
         enabled: true
         format: 
           json:
             display_span_list: false
             span_attributes:
               - span_attr_1

Example output with a list of spans:

{
  "timestamp": "2023-10-30T14:09:34.771388Z",
  "level": "INFO",
  "fields": {
    "event_attr_1": "event_attr_1",
    "event_attr_2": "event_attr_2"
  },
  "target": "event_target",
  "span_attr_1": "span_attr_1"
}

To learn more, go to span_attributes docs.
By @​bnjjj in https://github.com/apollographql/router/pull/5867

Add a histogram metric tracking evaluated query plans (PR #​5875)

The router supports the new apollo.router.query_planning.plan.evaluated_plans histogram metric to track the number of evaluated query plans.

You can use it to help set an optimal supergraph.query_planning.experimental_plans_limit option that limits the number of query plans evaluated for a query and reduces the time spent planning.

By @​Geal in https://github.com/apollographql/router/pull/5875

🐛 Fixes

Fix Datadog sampling (PR #​5788)

The router's Datadog exporter has been fixed so that traces are sampled as intended.

Previously, the Datadog exporter's context may not have been set correctly, causing traces to be undersampled.

By @​BrynCooke & @​bnjjj in https://github.com/apollographql/router/pull/5788

📃 Configuration

General availability of Apollo usage report generation (#​5807)

The router's Apollo usage report generation feature that was previously experimental is now generally available.

If you used its experimental configuration, you should migrate to the new configuration options:

  • telemetry.apollo.experimental_apollo_metrics_reference_mode is now telemetry.apollo.metrics_reference_mode
  • telemetry.apollo.experimental_apollo_signature_normalization_algorithm is now telemetry.apollo.signature_normalization_algorithm
  • experimental_apollo_metrics_generation_mode has been removed because the Rust implementation (the default since router v1.49.0) is generating reports identical to the previous router-bridge implementation

The experimental configuration options are now deprecated. They are functional but will log warnings.

By @​bonnici in https://github.com/apollographql/router/pull/5807

Helm: Enable easier Kubernetes debugging with heaptrack (Issue #​5789)

The router's Helm chart has been updated to help make debugging with heaptrack easier.

Previously, when debugging multiple Pods with heaptrack, all Pods wrote to the same file, so they'd overwrite each others' results. This issue has been fixed by adding a hostname to each output data file from heaptrack.

Also, the Helm chart now supports a restartPolicy that enables you to configure a Pod's restart policy. The default value of restartPolicy is Always (the same as the Kubernetes default).

By @​cyberhck in https://github.com/apollographql/router/pull/5850

📚 Documentation

Document OpenTelemetry information for operation limits (PR #​5884)

The router's docs for operation limits now describe using telemetry to set operation limits and logging values.

By @​andrewmcgivery in https://github.com/apollographql/router/pull/5884

v1.53.0

Compare Source

[!IMPORTANT]
If you have enabled Distributed query plan caching, this release changes the hashing algorithm used for the cache keys. On account of this, you should anticipate additional cache regeneration cost when updating between these versions while the new hashing algorithm comes into service.

🚀 Features

Support demand control directives (PR #​5777)

⚠️ This is a GraphOS Router feature.

The router supports two new demand control directives, @cost and @listSize, that you can use to provide more accurate estimates of GraphQL operation costs to the router's demand control plugin.

Use the @cost directive to customize the weights of operation cost calculations, particularly for expensive resolvers.

type Product {
  id: ID!
  name: String
  expensiveField: Int @​cost(weight: 20)
}

Use the @listSize directive to provide a more accurate estimate for the size of a specific list field, particularly for those that differ greatly from the global list size estimate.

type Magazine {

### This is assumed to always return 5 items
  headlines: [Article] @​listSize(assumedSize: 5)

### This is estimated to return as many items as are requested by the parameter named "first"
  getPage(first: Int!, after: ID!): [Article]
    @​listSize(slicingArguments: ["first"])
}

To learn more, go to Demand Control docs.

By @​tninesling in https://github.com/apollographql/router/pull/5777

General Availability (GA) of Demand Control (PR #​5868)

Demand control in the router is now a generally available (GA) feature.

GA compatibility update: if you used demand control during its preview, to use it in GA you must update your configuration from preview_demand_control to demand_control.

To learn more, go to Demand Control docs.

By @​tninesling in https://github.com/apollographql/router/pull/5868

Enable native query planner to run in the background (PR #​5790, PR #​5811, PR #​5771, PR #​5860)

The router now schedules background jobs to run the native (Rust) query planner to compare its results to the legacy implementation. This helps ascertain its correctness before making a decision to switch entirely to it from the legacy query planner.

To learn more, go to Experimental Query Planner Mode docs.

The router continues to use the legacy query planner to plan and execute operations, so there is no effect on the hot path.

To disable running background comparisons with the native query planner, you can configure the router to enable only the legacy query planner:

experimental_query_planner_mode: legacy

By @​SimonSapin in (PR #​5790, PR #​5811, PR #​5771 PR #​5860)

Add warnings for invalid configuration of custom telemetry (PR #​5759)

The router now logs warnings when running with telemetry that may have invalid custom configurations.

For example, you may customize telemetry using invalid conditions or inaccessible statuses:

telemetry:
  instrumentation:
    events:
      subgraph:
        my.event:
          message: "Auditing Router Event"
          level: info
          on: request
          attributes:
            subgraph.response.status: code

### Warning: should use selector for subgraph_name: true instead of comparing strings of subgraph_name and product
          condition:
            eq:
            - subgraph_name
            - product

Although the configuration is syntactically correct, its customization is invalid, and the router now outputs warnings for such invalid configurations.

By @​bnjjj in https://github.com/apollographql/router/pull/5759

Add V8 heap usage metrics (PR #​5781)

The router supports new gauge metrics for tracking heap memory usage of the V8 Javascript engine:

  • apollo.router.v8.heap.used: heap memory used by V8, in bytes
  • apollo.router.v8.heap.total: total heap allocated by V8, in bytes

By @​Geal in https://github.com/apollographql/router/pull/5781

Update Federation to v2.9.0 (PR #​5902)

This updates the router to Federation v2.9.0.

By @​tninesling in https://github.com/apollographql/router/pull/5902

Helm: Support maxSurge and maxUnavailable for rolling updates (Issue #​5664)

The router Helm chart now supports the configuration of maxSurge and maxUnavailable for the RollingUpdate deployment strategy.

By @​theJC in https://github.com/apollographql/router/pull/5665

Support new telemetry trace ID format (PR #​5735)

The router supports a new UUID format for telemetry trace IDs.

The following formats are supported in router configuration for trace IDs:

  • open_telemetry
  • hexadecimal (same as opentelemetry)
  • decimal
  • datadog
  • uuid (may contain dashes)

You can configure router logging to display the formatted trace ID with display_trace_id:

 telemetry:
  exporters:
    logging:
      stdout:
        format:
          json:
            display_trace_id: (true|false|open_telemetry|hexadecimal|decimal|datadog|uuid)

By @​bnjjj in https://github.com/apollographql/router/pull/5735

Add format for trace ID propagation. (PR #​5803)

The router now supports specifying the format of trace IDs that are propagated to subgraphs via headers.

You can configure the format with the format option:

telemetry:
  exporters:
    tracing:
      propagation:
        request:
          header_name: "my_header"

### Must be in UUID form, with or without dashes
          format: uuid

Note that incoming requests must be some form of UUID, either with or without dashes.

To learn about supported formats, go to request configuration reference docs.

By @​BrynCooke in https://github.com/apollographql/router/pull/5803

New apollo.router.cache.storage.estimated_size gauge (PR #​5770)

The router supports the new metric apollo.router.cache.storage.estimated_size that helps users understand and monitor the amount of memory that query planner cache entries consume.

The apollo.router.cache.storage.estimated_size metric gives an estimated size in bytes of a cache entry. It has the following attributes:

  • kind: query planner.
  • storage: memory.

Before using the estimate to decide whether to update the cache, users should validate that the estimate correlates with their pod's memory usage.

To learn how to troubleshoot with this metric, see the Pods terminating due to memory pressure guide in docs.

By @​BrynCooke in https://github.com/apollographql/router/pull/5770

🐛 Fixes

Fix GraphQL query directives validation bug (PR #​5753)

The router now supports GraphQL queries where a variable is used in a directive on the same operation where the variable is declared.

For example, the following query both declares and uses $var:

query GetSomething(: Int!) @​someDirective(argument: $var) {
  something
}

By @​goto-bus-stop in https://github.com/apollographql/router/pull/5753

Evaluate selectors in response stage when possible (PR #​5725)

The router now supports having various supergraph selectors on response events.

Because events are triggered at a specific event (request|response|error), you usually have only one condition for a related event. You can however have selectors that can be applied to several events, like subgraph_name to get the subgraph name).

Example of an event to log the raw subgraph response only on a subgraph named products, this was not working before.

telemetry:
  instrumentation:
    events:
      subgraph:
        response:
          level: info
          condition:
            eq:
            - subgraph_name: true
            - "products"

By @​bnjjj in https://github.com/apollographql/router/pull/5725

Fix trace propagation via header (PR #​5802)

The router now correctly propagates trace IDs when using the propagation.request.header_name configuration option.

telemetry:
  exporters:
    tracing:
      propagation:
        request:
          header_name: "id_from_header"

Previously, trace IDs weren't transferred to the root span of the request, causing spans to be incorrectly attributed to new traces.

By @​BrynCooke in https://github.com/apollographql/router/pull/5802

Add argument cost to type cost in demand control scoring algorithm (PR #​5740)

The router's operation scoring algorithm for demand control now includes field arguments in the type cost.

By @​tninesling in https://github.com/apollographql/router/pull/5740

Support gt/lt conditions for parsing string selectors to numbers (PR #​5758)

The router now supports greater than (gt) and less than (lt) conditions for header selectors.

The following example applies an attribute on a span if the content-length header is greater than 100:

telemetry:
  instrumentation:
    spans:
      mode: spec_compliant
      router:
        attributes:
          trace_id: true
          payload_is_to_big: # Set this attribute to true if the value of content-length header is > than 100
            static: true
            condition:
              gt:
              - request_header: "content-length"
              - 100

By @​bnjjj in https://github.com/apollographql/router/pull/5758

Set subgraph error path if not present (PR #​5773)

The router now sets the error path in all cases during subgraph response conversion. Previously the router's subgraph service didn't set the error path for some network-level errors.

By @​Geal in https://github.com/apollographql/router/pull/5773

Fix cost result filtering for custom metrics (PR #​5838)

The router can now filter for custom metrics that use demand control cost information in their conditions. This allows a telemetry config such as the following:

telemetry:
  instrumentation:
    instruments:
      supergraph:
        cost.rejected.operations:
          type: histogram
          value:
            cost: estimated
          description: "Estimated cost per rejected operation."
          unit: delta
          condition:
            eq:
              - cost: result
              - "COST_ESTIMATED_TOO_EXPENSIVE"

This also fixes an issue where attribute comparisons would fail silently when comparing integers to float values. Users can now write integer values in conditions that compare against selectors that select floats:

telemetry:
  instrumentation:
    instruments:
      supergraph:
        cost.rejected.operations:
          type: histogram
          value:
            cost: actual
          description: "Estimated cost per rejected operation."
          unit: delta
          condition:
            gt:
              - cost: delta
              - 1

By @​tninesling in https://github.com/apollographql/router/pull/5838

Fix missing apollo_router_cache_size metric (PR #​5770)

Previously, if the in-memory cache wasn't mutated, the apollo_router_cache_size metric wouldn't be available. This has been fixed in this release.

By @​BrynCooke in https://github.com/apollographql/router/pull/5770

Interrupted subgraph connections trigger error responses and subgraph service hook points (PR #​5859)

The router now returns a proper subgraph response, with an error if necessary, when a subgraph connection is closed or returns an error.

Previously, this issue prevented the subgraph response service from being triggered in coprocessors or Rhai scripts.

By @​bnjjj in https://github.com/apollographql/router/pull/5859

Fix exists condition for custom telemetry events (Issue #​5702)

The router now properly handles the exists condition for events. The following configuration now works as intended:

telemetry:
  instrumentation:
    events:
      supergraph:
        my.event:
          message: "Auditing Router Event"
          level: info
          on: request
          attributes:
            graphql.operation.name: true
          condition:
            exists:
              operation_name: string

By @​bnjjj in https://github.com/apollographql/router/pull/5759

Fix Datadog underreporting APM metrics (PR #​5780)

The previous PR #​5703 has been reverted in this release because it caused Datadog to underreport APM span metrics.

By @​BrynCooke in https://github.com/apollographql/router/pull/5780

Fix inconsistent type attribute in apollo.router.uplink.fetch.duration metric (PR #​5816)

The router now always reports a short name in the type attribute for the apollo.router.fetch.duration metric, instead of sometimes using a fully-qualified Rust path and sometimes using a short name.

By @​goto-bus-stop in https://github.com/apollographql/router/pull/5816

Enable progressive override with Federation 2.7 and above (PR #​5754)

The progressive override feature is now available when using Federation v2.7 and above.

By @​o0ignition0o in https://github.com/apollographql/router/pull/5754

Support supergraph query selector for events (PR #​5764)

The router now supports the query: root_fields selector for event_response. Previously the selector worked for response stage events but didn't work for event_response.

The following configuration for a query: root_fields on an event_response now works:

telemetry:
  instrumentation:
    events:
      supergraph:
        OPERATION_LIMIT_INFO:
          message: operation limit info
          on: event_response
          level: info
          attributes:
            graphql.operation.name: true
            query.root_fields:
              query: root_fields

By @​bnjjj in https://github.com/apollographql/router/pull/5764

Fix session counting and the reporting of file handle shortage (PR #​5834)

The router previously gave incorrect warnings about file handle shortages due to session counting incorrectly including connections to health-check connections or other non-GraphQL connections. This is now corrected so that only connections to the main GraphQL port are counted, and file handle shortages are now handled correctly as a global resource.

Also, the router's port listening logic had its own custom rate-limiting of log notifications. This has been removed and replaced by the standard router log rate limiting configuration

By @​garypen in https://github.com/apollographql/router/pull/5834

📃 Configuration

Increase default Redis timeout (PR #​5795)

The default Redis command timeout was increased from 2ms to 500ms to accommodate common production use cases.

By @​Geal in https://github.com/apollographql/router/pull/5795

🛠 Maintenance

Improve performance by optimizing telemetry meter and instrument creation (PR #​5629)

The router's performance has been improved by removing telemetry creation out of the critical path, from being created in every service to being created when starting the telemetry plugin.

By @​bnjjj in https://github.com/apollographql/router/pull/5629

📚 Documentation

Add sections on using @cost and @listSize to demand control docs (PR #​5839)

Updates the demand control documentation to include details on @cost and @listSize for more accurate cost estimation.

By @​tninesling in https://github.com/apollographql/router/pull/5839

v1.52.1

Compare Source

[!IMPORTANT]
If you have enabled Distributed query plan caching, this release changes the hashing algorithm used for the cache keys. On account of this, you should anticipate additional cache regeneration cost when updating between these versions while the new hashing algorithm comes into service.

🔒 Security

CVE-2024-43783: Payload limits may exceed configured maximum

Correct a denial-of-service vulnerability which, under certain non-default configurations below, made it possible to exceed the configured request payload maximums set with the limits.http_max_request_bytes option.

This affects the following non-default Router configurations:

  1. Those configured to send request bodies to External Coprocessors where the coprocessor.router.request.body configuration option is set to true; or
  2. Those which declare custom native Rust plugins using the plugins configuration where those plugins access the request body in the RouterService layer.

Rhai plugins are not impacted. See the associated Github Advisory, GHSA-x6xq-whh3-gg32, for more information.

CVE-2024-43414: Update query planner to resolve uncontrolled recursion

Update the version of @apollo/query-planner used by Router to v2.8.5 which corrects an uncontrolled recursion weakness (classified as CWE-674) during query planning for complex queries on particularly complex graphs.

This weakness impacts all versions of Router prior to this release. See the associated Github Advisory, GHSA-fmj9-77q8-g6c4, for more information.

v1.52.0

Compare Source

🚀 Features

Provide helm support for when router's health_check's default path is not being used(Issue #​5652)

When helm chart is defining the liveness and readiness check probes, if the router has been configured to use a non-default health_check path, use that rather than the default ( /health )

By Jon Christiansen in https://github.com/apollographql/router/pull/5653

Support new span and metrics formats for entity caching (PR #​5625)

Metrics of the router's entity cache have been converted to the latest format with support for custom telemetry.

The following example configuration shows the the cache instrument, the cache selector in the subgraph service, and the cache attribute of a subgraph span:

telemetry:
  instrumentation:
    instruments:
      default_requirement_level: none
      cache:
        apollo.router.operations.entity.cache:
          attributes:
            entity.type: true
            subgraph.name:
              subgraph_name: true
            supergraph.operation.name:
              supergraph_operation_name: string
      subgraph:
        only_cache_hit_on_subgraph_products:
          type: counter
          value:
            cache: hit
          unit: hit
          description: counter of subgraph request cache hit on subgraph products
          condition:
            all:
            - eq:
              - subgraph_name: true
              - products
            - gt:
              - cache: hit
              - 0
          attributes:
            subgraph.name: true
            supergraph.operation.name:
              supergraph_operation_name: string

To learn more, go to Entity caching docs.

By @​Geal and @​bnjjj in https://github.com/apollographql/router/pull/5625

Helm: Support renaming key for retrieving APOLLO_KEY secret (Issue #​5661)

A user of the router Helm chart can now rename the key used to retrieve the value of the secret key referenced by APOLLO_KEY.

Previously, the router Helm chart hardcoded the key name to managedFederationApiKey. This didn't support users whose infrastructure required custom key names when getting secrets, such as Kubernetes users who need to use specific key names to access a secretStore or externalSecret. This change provides a user the ability to control the name of the key to use in retrieving that value.

By Jon Christiansen in https://github.com/apollographql/router/pull/5662

🐛 Fixes

Prevent Datadog timeout errors in logs (Issue #​2058)

The router's Datadog exporter has been updated to reduce the frequency of logged errors related to connection pools.

Previously, the connection pools used by the Datadog exporter frequently timed out, and each timeout logged an error like the following:

2024-07-19T15:28:22.970360Z ERROR  OpenTelemetry trace error occurred: error sending request for url (http://127.0.0.1:8126/v0.5/traces): connection error: Connection reset by peer (os error 54)

Now, the pool timeout for the Datadog exporter has been changed so that timeout errors happen much less frequently.

By @​BrynCooke in https://github.com/apollographql/router/pull/5692

Allow service version overrides (PR #​5689)

The router now supports configuration of service.version via YAML file configuration. This enables users to produce custom versioned builds of the router.

The following example overrides the version to be 1.0:

telemetry:
  exporters:
    tracing:
      common:
        resource:
          service.version: 1.0

By @​BrynCooke in https://github.com/apollographql/router/pull/5689

Populate Datadog span.kind (PR #​5609)

Because Datadog traces use span.kind to differentiate between different types of spans, the router now ensures that span.kind is correctly populated using the OpenTelemetry span kind, which has a 1-2-1 mapping to those set out in dd-trace.

By @​BrynCooke in https://github.com/apollographql/router/pull/5609

Remove unnecessary internal metric events from traces and spans (PR #​5649)

The router no longer includes some internal metric events in traces and spans that shouldn't have been included originally.

By @​bnjjj in https://github.com/apollographql/router/pull/5649

Support Datadog span metrics (PR #​5609)

When using the APM view in Datadog, the router now displays span metrics for top-level spans or spans with the _dd.measured flag set.

The router sets the _dd.measured flag by default for the following spans:

  • request
  • router
  • supergraph
  • subgraph
  • subgraph_request
  • http_request
  • query_planning
  • execution
  • query_parsing

To enable or disable span metrics for any span, configure span_metrics for the Datadog exporter:

telemetry:
  exporters:
    tracing:
      datadog:
        enabled: true
        span_metrics:

### Disable span metrics for supergraph
          supergraph: false

### Enable span metrics for my_custom_span
          my_custom_span: true

By @​BrynCooke in https://github.com/apollographql/router/pull/5609 and https://github.com/apollographql/router/pull/5703

Use spawn_blocking for query parsing and validation (PR #​5235)

To prevent its executor threads from blocking on large queries, the router now runs query parsing and validation in a Tokio blocking task.

By @​xuorig in https://github.com/apollographql/router/pull/5235

🛠 Maintenance

chore: Update rhai to latest release (1.19.0) (PR #​5655)

In Rhai 1.18.0, there were changes to how exceptions within functions were created. For details see: https://github.com/rhaiscript/rhai/blob/7e0ac9d3f4da9c892ed35a211f67553a0b451218/CHANGELOG.md?plain=1#L12

We've modified how we handle errors raised by Rhai to comply with this change, which means error message output is affected. The change means that errors in functions will no longer document which function the error occurred in, for example:

-         "rhai execution error: 'Runtime error: I have raised an error (line 223, position 5)\nin call to function 'process_subgraph_response_string''"
+         "rhai execution error: 'Runtime error: I have raised an error (line 223, position 5)'"

Making this change allows us to keep up with the latest version (1.19.0) of Rhai.

By @​garypen in https://github.com/apollographql/router/pull/5655

Add version in the entity cache hash (PR #​5701)

The hashing algorithm of the router's entity cache has been updated to include the entity cache version.

[!IMPORTANT]
If you have previously enabled entity caching, you should expect additional cache regeneration costs when updating to this version of the router while the new hashing algorithm comes into service.

By @​bnjjj in https://github.com/apollographql/router/pull/5701

Improve testing by avoiding cache effects and redacting tracing details (PR #​5638)

We've had some problems with flaky tests and this PR addresses some of them.

The router executes in parallel and concurrently. Many of our tests use snapshots to try and make assertions that functionality is continuing to work correctly. Unfortunately, concurrent/parallel execution and static snapshots don't co-operate very well. Results may appear in pseudo-random order (compared to snapshot expectations) and so tests become flaky and fail without obvious cause.

The problem becomes particularly acute with features which are specifically designed for highly concurrent operation, such as batching.

This set of changes addresses some of the router testing problems by:

  1. Making items in a batch test different enough that caching effects are avoided.
  2. Redacting various details so that sequencing is not as much of an issue in the otel traces tests.

By @​garypen in https://github.com/apollographql/router/pull/5638

📚 Documentation

Update router naming conventions (PR #​5400)

Renames our router product to distinguish between our non-commercial and commercial offerings. Instead of referring to the Apollo Router, we now refer to the following:

  • Apollo Router Core is Apollo’s free-and-open (ELv2 licensed) implementation of a routing runtime for supergraphs.
  • GraphOS Router is based on the Apollo Router Core and fully integrated with GraphOS. GraphOS Routers provide access to GraphOS’s commercial runtime features.

By @​shorgi in https://github.com/apollographql/router/pull/5400

🧪 Experimental

Enable Rust-based API schema implementation (PR #​5623)

The router has transitioned to solely using a Rust-based API schema generation implementation.

Previously, the router used a Javascript-based implementation. After testing for a few months, we've validated the improved performance and robustness of the new Rust-based implementation, so the router now only uses it.

By @​goto-bus-stop in https://github.com/apollographql/router/pull/5623

v1.51.0

Compare Source

🚀 Features

Support conditional coprocessor execution per stage of request lifecycle (PR #​5557)

The router now supports conditional execution of the coprocessor for each stage of the request lifecycle (except for the Execution stage).

To configure, define conditions for a specific stage by using selectors based on headers or context entries. For example, based on a supergraph response you can configure the coprocessor not to execute for any subscription:

coprocessor:
  url: http://127.0.0.1:3000 # mandatory URL which is the address of the coprocessor
  timeout: 2s # optional timeout (2 seconds in this example). If not set, defaults to 1 second
  supergraph:
    response: 
      condition:
        not:
          eq:
          - subscription
          - operation_kind: string
      body: true

To learn more, see the documentation about coprocessor conditions.

By @​bnjjj in https://github.com/apollographql/router/pull/5557

Add option to deactivate introspection response caching (PR #​5583)

The router now supports an option to deactivate introspection response caching. Because the router caches responses as introspection happens in the query planner, cached introspection responses may consume too much of the distributed cache or fill it up. Setting this option prevents introspection responses from filling up the router's distributed cache.

To deactivate introspection caching, set supergraph.query_planning.legacy_introspection_caching to false:

supergraph:
  query_planning:
    legacy_introspection_caching: false

By @​Geal in https://github.com/apollographql/router/pull/5583

Add 'subgraph_on_graphql_error' selector for subgraph (PR #​5622)

The router now supports the subgraph_on_graphql_error selector for the subgraph service, which it already supported for the router and supergraph services. Subgraph service support enables easier detection of GraphQL errors in response bodies of subgraph requests.

An example configuration with subgraph_on_graphql_error configured:

telemetry:
  instrumentation:
    instruments:
      subgraph:
        http.client.request.duration:
          attributes:
            subgraph.graphql.errors: # attribute containing a boolean set to true if response.errors is not empty
              subgraph_on_graphql_error: true

By @​bnjjj in https://github.com/apollographql/router/pull/5622

🐛 Fixes

Add response_context in event selector for event_* instruments (PR #​5565)

The router now supports creating custom instruments with a value set to event_* and using both a condition executed on an event and the response_context selector in attributes. Previous releases didn't support the response_context selector in attributes.

An example configuration:

telemetry:
  instrumentation:
    instruments:
      supergraph:
        sf.graphql_router.errors:
          value: event_unit
          type: counter
          unit: count
          description: "graphql errors handled by the apollo router"
          condition:
            eq:
            - true
            - on_graphql_error: true
          attributes:
            "operation":
              response_context: "operation_name" # This was not working before

By @​bnjjj in https://github.com/apollographql/router/pull/5565

Provide valid trace IDs for unsampled traces in Rhai scripts (PR #​5606)

The traceid() function in a Rhai script for the router now returns a valid trace ID for all traces.

Previously, traceid() didn't return a trace ID if the trace wasn't selected for sampling.

By @​bnjjj in https://github.com/apollographql/router/pull/5606

Allow query batching and entity caching to work together (PR #​5598)

The router now supports entity caching and subgraph batching to run simultaneously. Specifically, this change updates entity caching to ignore a subgraph request if the request is part of a batch.

By @​garypen in https://github.com/apollographql/router/pull/5598

Gracefully handle subgraph response with -1 values inside error locations (PR #​5633)

This router now gracefully handles responses that contain invalid "-1" positional values for error locations in queries by ignoring those invalid locations.

This change resolves the problem of GraphQL Java and GraphQL Kotlin using { "line": -1, "column": -1 } values if they can't determine an error's location in a query, but the GraphQL specification requires both line and column to be positive numbers.

As an example, a subgraph can respond with invalid error locations:

{
    "data": { "topProducts": null },
    "errors": [{
        "message":"Some error on subgraph",
        "locations": [
            { "line": -1, "column": -1 },
        ],
        "path":["topProducts"]
    }]
}

With this change, the router returns a response that ignores the invalid locations:

{
    "data": { "topProducts": null },
    "errors": [{
        "message":"Some error on subgraph",
        "path":["topProducts"]
    }]
}

By @​IvanGoncharov in https://github.com/apollographql/router/pull/5633

Return request timeout and rate limited error responses as structured errors (PR #​5578)

The router now returns request timeout errors (408 Request Timeout) and request rate limited errors (429 Too Many Requests) as structured GraphQL errors (for example, {"errors": [...]}). Previously, the router returned these as plaintext errors to clients.

Both types of errors are properly tracked in telemetry, including the apollo_router_graphql_error_total metric.

By @​IvanGoncharov in https://github.com/apollographql/router/pull/5578

Fix span names and resource mapping for Datadog trace exporter (Issue #​5282)

[!NOTE]
This is an incremental improvement, but we expect more improvements in Router v1.52.0 after https://github.com/apollographql/router/pull/5609/ lands.

The router now uses static span names by default. This change fixes the user experience of the Datadog trace exporter when sending traces with Datadog native configuration.

The router has two ways of sending traces to Datadog:

  1. The OpenTelemetry for Datadog approach (which is the recommended method). This is identified by otlp in YAML configuration, and it is not impacted by this fix.
  2. The "Datadog native" configuration. This is identified by the use of a datadog: key in YAML configuration.

This change fixes a bug in the latter approach that broke some Datadog experiences, such as the "Resources" section of the Datadog APM Service Catalog page.

We now use static span names by default, with resource mappings providing additional context when requested, which enables the desired behavior which was not possible before.

If for some reason you wish to maintain the existing behavior, you must either update your spans and resource mappings, or keep your spans and instead configure the router to use dynamic span names and disable resource mapping.

Enabling resource mapping and fixed span names is configured by the enable_span_mapping and fixed_span_names options:

telemetry:
  exporters:
    tracing:
      datadog:
        enabled: true

### Enables resource mapping, previously disabled by default, but now enabled.
        enable_span_mapping: true

### Enables fixed span names, defaults to true.
        fixed_span_names: true

  instrumentation:
    spans:
      mode: spec_compliant

With enable_span_mapping set to true (now default), the following resource mappings are applied:

OpenTelemetry Span Name Datadog Span Operation Name
request http.route
router http.route
supergraph graphql.operation.name
query_planning graphql.operation.name
subgraph subgraph.name
subgraph_request graphql.operation.name
http_request http.route

You can override the default resource mappings by specifying the resource_mapping configuration:

telemetry:
  exporters:
    tracing:
      datadog:
        enabled: true
        resource_mapping:

### Use `my.span.attribute` as the resource name for the `router` span
          router: "my.span.attribute"

To learn more, see the Datadog trace exporter documentation.

By @​bnjjj and @​bryncooke in https://github.com/apollographql/router/pull/5386

📚 Documentation

Update documentation for ignore_other_prefixes (PR #​5592)

Update JWT authentication documentation to clarify the behavior of the ignore_other_prefixes configuration option.

By @​andrewmcgivery in https://github.com/apollographql/router/pull/5592

v1.50.0

Compare Source

🚀 Features

Support local persisted query manifests for use with offline licenses (Issue #​4587)

Adds experimental support for passing persisted query manifests to use instead of the hosted Uplink version.

For example:

persisted_queries:
  enabled: true
  log_unknown: true
  experimental_local_manifests: 
    - ./persisted-query-manifest.json
  safelist:
    enabled: true
    require_id: false

By @​lleadbet in https://github.com/apollographql/router/pull/5310

Support conditions on standard telemetry events (Issue #​5475)

Enables setting conditions on standard events.
For example:

telemetry:
  instrumentation:
    events:
      router:
        request:
          level: info
          condition: # Only log the router request if you sent `x-log-request` with the value `enabled`
            eq:
            - request_header: x-log-request
            - "enabled"
        response: off
        error: error

### ...

Not supported for batched requests.
By @​bnjjj in https://github.com/apollographql/router/pull/5476

Make status_code available for router_service responses in Rhai scripts (Issue #​5357)

Adds response.status_code on Rhai router_service responses. Previously, status_code was only available on subgraph_service responses.

For example:

fn router_service(service) {
    let f = |response| {
        if response.is_primary() {
            print(response.status_code);
        }
    };

    service.map_response(f);
}

By @​IvanGoncharov in https://github.com/apollographql/router/pull/5358

Add new values for the supergraph query selector (PR #​5433)

Adds support for four new values for the supergraph query selector:

  • aliases: the number of aliases in the query
  • depth: the depth of the query
  • height: the height of the query
  • root_fields: the number of root fields in the query

You can use this data to understand how your graph is used and to help determine where to set limits.

For example:

telemetry:
  instrumentation:
    instruments:
      supergraph:
        'query.depth':
          description: 'The depth of the query'
          value:
            query: depth
          unit: unit
          type: histogram

By @​garypen in https://github.com/apollographql/router/pull/5433

Add the ability to drop metrics using otel views (PR #​5531)

You can drop specific metrics if you don't want these metrics to be sent to your APM using otel views.

telemetry:
  exporters:
    metrics:
      common:
        service_name: apollo-router
        views:
          - name: apollo_router_http_request_duration_seconds # Instrument name you want to edit. You can use wildcard in names. If you want to target all instruments just use '*'
            aggregation: drop

By @​bnjjj in https://github.com/apollographql/router/pull/5531

Add operation_name selector for router service in custom telemetry (PR #​5392)

Adds an operation_name selector for the router service.
Previously, accessing operation_name was only possible through the response_context router service selector.

For example:

telemetry:
  instrumentation:
    instruments:
      router:
        http.server.request.duration:
          attributes:
            graphql.operation.name:
              operation_name: string

By @​bnjjj in https://github.com/apollographql/router/pull/5392

🐛 Fixes

Fix Cache-Control aggregation and age calculation in entity cac

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/apollo-graphql-packages branch 2 times, most recently from a4a4c53 to 6d747ab Compare October 20, 2023 22:30
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.0 chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.1 Oct 20, 2023
@renovate renovate bot force-pushed the renovate/apollo-graphql-packages branch from 6d747ab to 9de57e1 Compare October 26, 2023 17:14
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.1 chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 Oct 26, 2023
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed Oct 28, 2023
@renovate renovate bot closed this Oct 28, 2023
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch October 28, 2023 09:28
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 Oct 28, 2023
@renovate renovate bot reopened this Oct 28, 2023
@renovate renovate bot restored the renovate/apollo-graphql-packages branch October 28, 2023 15:03
@renovate renovate bot force-pushed the renovate/apollo-graphql-packages branch from 9de57e1 to ad7b75f Compare October 28, 2023 15:03
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed Nov 1, 2023
@renovate renovate bot closed this Nov 1, 2023
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch November 1, 2023 18:15
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 Nov 1, 2023
@renovate renovate bot reopened this Nov 1, 2023
@renovate renovate bot restored the renovate/apollo-graphql-packages branch November 1, 2023 21:19
@renovate renovate bot force-pushed the renovate/apollo-graphql-packages branch from ad7b75f to 7fb0e73 Compare November 1, 2023 21:19
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed Nov 3, 2023
@renovate renovate bot closed this Nov 3, 2023
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch November 3, 2023 13:55
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 Nov 3, 2023
@renovate renovate bot reopened this Nov 3, 2023
@renovate renovate bot restored the renovate/apollo-graphql-packages branch November 3, 2023 16:07
@renovate renovate bot force-pushed the renovate/apollo-graphql-packages branch from 7fb0e73 to ea6d4b8 Compare November 3, 2023 16:07
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed Nov 4, 2023
@renovate renovate bot closed this Nov 4, 2023
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch November 4, 2023 00:19
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.33.2 Nov 4, 2023
@renovate renovate bot restored the renovate/apollo-graphql-packages branch September 6, 2024 11:28
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 Sep 6, 2024
@renovate renovate bot reopened this Sep 6, 2024
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 - autoclosed Sep 8, 2024
@renovate renovate bot closed this Sep 8, 2024
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch September 8, 2024 22:46
@renovate renovate bot restored the renovate/apollo-graphql-packages branch September 9, 2024 00:39
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 Sep 9, 2024
@renovate renovate bot reopened this Sep 9, 2024
@renovate renovate bot force-pushed the renovate/apollo-graphql-packages branch from 73c4aee to 231083f Compare September 10, 2024 23:18
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.53.0 chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 Sep 10, 2024
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 - autoclosed Sep 11, 2024
@renovate renovate bot closed this Sep 11, 2024
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch September 11, 2024 03:36
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 Sep 11, 2024
@renovate renovate bot restored the renovate/apollo-graphql-packages branch September 11, 2024 08:04
@renovate renovate bot reopened this Sep 11, 2024
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 - autoclosed Sep 12, 2024
@renovate renovate bot closed this Sep 12, 2024
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch September 12, 2024 23:08
@renovate renovate bot restored the renovate/apollo-graphql-packages branch September 13, 2024 00:56
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 Sep 13, 2024
@renovate renovate bot reopened this Sep 13, 2024
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 - autoclosed Sep 14, 2024
@renovate renovate bot closed this Sep 14, 2024
@renovate renovate bot deleted the renovate/apollo-graphql-packages branch September 14, 2024 10:11
@renovate renovate bot changed the title chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 - autoclosed chore(deps): update ghcr.io/apollographql/router docker tag to v1.54.0 Sep 14, 2024
@renovate renovate bot reopened this Sep 14, 2024
@renovate renovate bot restored the renovate/apollo-graphql-packages branch September 14, 2024 13:24
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.

0 participants