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

release: v1.16.0 #3033

Merged
merged 47 commits into from
May 3, 2023
Merged

release: v1.16.0 #3033

merged 47 commits into from
May 3, 2023

Commits on Apr 18, 2023

  1. linux: replace default allocator with jemalloc (#2882)

    Router execution results in a heavily fragmented heap, that is hard to manage for the default allocator. jemallocator handles it better, which results in performance improvements, in latency and memory usage
    garypen committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    dd8ca62 View commit details
    Browse the repository at this point in the history
  2. Add a private part to the Context structure (#2802)

    There's a cost in using the `Context` structure throughout a request's lifecycle, due to the JSON serialization and deserialization, so it should be reserved from inter plugin communication between rhai, coprocessor and Rust. But for internal router usage, we can have a more efficient structure that avoids serialization costs, and does not expose data that should not be modified by plugins.
    
    That structure is based on a map indexed by type id, which means that if some part of the code can see that type, then it can access it in the map.
    
    This means that some context data that was accessible from rhai and all plugins, is now inaccessible
    Geal committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    7d0f173 View commit details
    Browse the repository at this point in the history
  3. lighter path manipulation in response formatting (#2854)

    Response formatting generates a lot of temporary allocations to create response paths that end up unused. By making a reference based type to hold these paths, we can prevent those allocations and improve performance.
    Geal committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    fbc4b4a View commit details
    Browse the repository at this point in the history
  4. use a parking-lot mutex in cache storage (#2887)

    The in memory cache requires synchronization, and precedently we used a
    futures aware mutex for that, but those are susceptible to contention.
    This replaces that mutex with a parking-lot synchronous mutex that is
    much faster.
    
    ---------
    
    Co-authored-by: Gary Pennington <gary@apollographql.com>
    Geal and garypen committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    c0218a3 View commit details
    Browse the repository at this point in the history
  5. prevent span attributes from being formatted to write logs (#2890)

    we do not show span attributes in our logs, but the log formatter still
    spends some time formatting them to a string, even when there will be no
    logs written for the trace. This adds the `NullFieldFormatter` that
    entirely avoids formatting the attributes
    Geal committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    efd0033 View commit details
    Browse the repository at this point in the history
  6. Reconcile dev after merge to main for v1.15.1 (#2972)

    Follow-up to the v1.15.1 being officially released, bringing version
    bumps and changelog updates into the `dev` branch.
    abernix committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    1e6bd0d View commit details
    Browse the repository at this point in the history
  7. Parse Accept headers once instead of three times (#2847)

    This is a small performance improvement.
    
    When the `Accept` is not present, the previous code would still traverse
    the header map three times.
    SimonSapin committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    028f6d9 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. Rate limit otel errors (#2954)

    When a batch span exporter is unable to send accept a span because the
    buffer is full it will emit an error.
    These errors can be very frequent and could potentially impact
    performance.
    
    Otel errors are not rate limited to one every ten seconds per error
    type.
    
    Fixes #2953
    
    <!-- start metadata -->
    
    **Checklist**
    
    Complete the checklist (and note appropriate exceptions) before a final
    PR is raised.
    
    - [ ] Changes are compatible[^1]
    - [ ] Documentation[^2] completed
    - [ ] Performance impact assessed and acceptable
    - Tests added and passing[^3]
        - [x] Unit Tests
        - [ ] Integration Tests
        - [ ] Manual Tests
    
    **Exceptions**
    
    *Note any exceptions here*
    
    **Notes**
    
    [^1]. It may be appropriate to bring upcoming changes to the attention
    of other (impacted) groups. Please endeavour to do this before seeking
    PR approval. The mechanism for doing this will vary considerably, so use
    your judgement as to how and when to do this.
    [^2]. Configuration is an important part of many changes. Where
    applicable please try to document configuration examples.
    [^3]. Tick whichever testing boxes are applicable. If you are adding
    Manual Tests:
    - please document the manual testing (extensively) in the Exceptions.
    - please raise a separate issue to automate the test and label it (or
    ask for it to be labeled) as `manual test`
    
    ---------
    
    Co-authored-by: bryn <bryn@apollographql.com>
    BrynCooke and bryn committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    de4b1f2 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. feat: add support of operationCountByType for apollo studio (#2979)

    add support of operationCountByType for apollo studio
    
    ---------
    
    Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
    bnjjj committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    6cc999b View commit details
    Browse the repository at this point in the history
  2. use a parking-lot mutex in Context (#2885)

    The context requires synchronized access to the busy timer, and
    precedently we used a futures aware mutex for that, but those are
    susceptible to contention. This replaces that mutex with a parking-lot
    synchronous mutex that is much faster.
    Geal committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    e691bde View commit details
    Browse the repository at this point in the history
  3. Fix: Traffic shaping configuration fallback for experimental_enable_h…

    …ttp2 (#2976)
    
    Fix a bug where `experimental_enable_http2` wouldn't properly apply when
    a global configuration was set.
    o0Ignition0o committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    e34906b View commit details
    Browse the repository at this point in the history
  4. improve handling of deferred response errors in rhai scripts (#2945)

    Currently, if a rhai script errors in rhai, the rhai plugin ignores the
    error and returns None in the stream of results.
    
    This has two unfortunate aspects:
     - the error is not propagated to the client
     - the stream is terminated (silently)
    
    The fix captures the error and propagates the response to the client.
    
    Fixes #2935 #2936 
    
    <!-- start metadata -->
    
    **Checklist**
    
    Complete the checklist (and note appropriate exceptions) before a final
    PR is raised.
    
    - [x] Changes are compatible[^1]
    - [x] Documentation[^2] completed
    - [x] Performance impact assessed and acceptable
    - Tests added and passing[^3]
        - [x] Unit Tests
        ~- [ ] Integration Tests~
        - [x] Manual Tests
    
    **Exceptions**
    
    *Note any exceptions here*
    
    **Notes**
    
    [^1]. It may be appropriate to bring upcoming changes to the attention
    of other (impacted) groups. Please endeavour to do this before seeking
    PR approval. The mechanism for doing this will vary considerably, so use
    your judgement as to how and when to do this.
    [^2]. Configuration is an important part of many changes. Where
    applicable please try to document configuration examples.
    [^3]. Tick whichever testing boxes are applicable. If you are adding
    Manual Tests:
    - please document the manual testing (extensively) in the Exceptions.
    - please raise a separate issue to automate the test and label it (or
    ask for it to be labeled) as `manual test`
    garypen committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    c541edf View commit details
    Browse the repository at this point in the history
  5. deps: Use nu-ansi-term to replace unmaintained ansi_term (#2844)

    Partially fixes https://rustsec.org/advisories/RUSTSEC-2021-0139
    
    `clap` is still depending on
    [ansi_term](https://github.com/ogham/rust-ansi-term).
    
    cargo audit before the change:
    ```
    Crate:     ansi_term
    Version:   0.12.1
    Warning:   unmaintained
    Title:     ansi_term is Unmaintained
    Date:      2021-08-18
    ID:        RUSTSEC-2021-0139
    URL:       https://rustsec.org/advisories/RUSTSEC-2021-0139
    Dependency tree:
    ansi_term 0.12.1
    ├── clap 2.34.0
    │   ├── structopt 0.3.26
    │   │   └── cargo-scaffold 0.8.7
    │   │       └── apollo-router-scaffold 1.12.1
    │   └── cargo-scaffold 0.8.7
    └── apollo-router 1.12.1
        ├── throw-error 0.1.0
        ├── supergraph_sdl 0.1.0
        ├── rhai-surrogate-cache-key 0.1.0
        ├── rhai-subgraph-request-log 0.1.0
        ├── rhai-logging 0.1.0
        ├── rhai-error-response-mutate 0.1.0
        ├── rhai-data-response-mutate 0.1.0
        ├── propagate-status-code 0.1.0
        ├── op-name-to-header 0.1.0
        ├── jwt-claims 0.1.0
        ├── hello-world 0.1.0
        ├── forbid_anonymous_operations_rhai 0.1.0
        ├── forbid-anonymous-operations 0.1.0
        ├── external-subgraph 0.1.0
        ├── cookies-to-headers 0.1.0
        ├── context-data 0.1.0
        ├── async-allow-client-id 0.1.0
        ├── apollo-router-benchmarks 1.12.1
        └── add-timestamp-header 0.1.0
    ```
    
    cargo audit after the change:
    ```
    Crate:     ansi_term
    Version:   0.12.1
    Warning:   unmaintained
    Title:     ansi_term is Unmaintained
    Date:      2021-08-18
    ID:        RUSTSEC-2021-0139
    URL:       https://rustsec.org/advisories/RUSTSEC-2021-0139
    Dependency tree:
    ansi_term 0.12.1
    └── clap 2.34.0
        ├── structopt 0.3.26
        │   └── cargo-scaffold 0.8.7
        │       └── apollo-router-scaffold 1.12.1
        └── cargo-scaffold 0.8.7
    ```
    
    Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
    yanns and bnjjj committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    af58509 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. Configuration menu
    Copy the full SHA
    737dc05 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2023

  1. Configuration menu
    Copy the full SHA
    d50aed1 View commit details
    Browse the repository at this point in the history
  2. activate the compression layer for all requests

    so this will be measured by CI benchmarks and serve as baseline for
    upcoming changes
    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    abae695 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c6b312 View commit details
    Browse the repository at this point in the history
  4. vendor encoders from async-compression

    This integrates the encoders from
    https://github.com/Nemo157/async-compression so we can use them other a
    stream that flushes data regularly
    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    3cd2e3f View commit details
    Browse the repository at this point in the history
  5. implement streaming compression

    this makes an assumption that async-commpression cannot make: every
    chunk in the body stream has to be compressed and flushed directly, we
    should not wait for more data to come and get better compression.
    This is due to the multipart protocol for defer: we know each chunk
    represent eitehr the primary or a deferred response, and should be sent
    as soon as possible
    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    3a3412c View commit details
    Browse the repository at this point in the history
  6. add more algorithms

    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    cce57c4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0d8cb2d View commit details
    Browse the repository at this point in the history
  8. lint

    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    0f6de99 View commit details
    Browse the repository at this point in the history
  9. fmt

    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    e33a9cf View commit details
    Browse the repository at this point in the history
  10. fix the Content-Encoding header

    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    f7f6d78 View commit details
    Browse the repository at this point in the history
  11. fix tests

    Geal committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    992fb74 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2023

  1. Configuration menu
    Copy the full SHA
    177e837 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    19a3a66 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bc63b32 View commit details
    Browse the repository at this point in the history
  4. Revert "merge dev in staging perf" (#2990)

    Reverts #2989
    Geal committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    1e433fd View commit details
    Browse the repository at this point in the history
  5. fixes

    Geal committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    0fb0ba9 View commit details
    Browse the repository at this point in the history
  6. lint

    Geal committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    07f6fff View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2023

  1. Configuration menu
    Copy the full SHA
    faaa7f0 View commit details
    Browse the repository at this point in the history
  2. Update apollo-router/src/axum_factory/axum_http_server_factory.rs

    Co-authored-by: Jeremy Lempereur <jeremy.lempereur@iomentum.com>
    Geal and o0Ignition0o committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    aa341a6 View commit details
    Browse the repository at this point in the history
  3. remove zlib

    Geal committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    56b47fd View commit details
    Browse the repository at this point in the history
  4. changeset

    Geal committed Apr 26, 2023
    Configuration menu
    Copy the full SHA
    2e4cec7 View commit details
    Browse the repository at this point in the history

Commits on Apr 27, 2023

  1. lint

    Geal committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    0fbaed1 View commit details
    Browse the repository at this point in the history
  2. Ensure --prerelease flag is passed to gh create release for pre-r…

    …eleases (#3004)
    
    This changes our script to be explicit and pass the `--prerelease`
    version
    to our increasingly automated release pipeline when the `-` character is
    detected in the "version" property of the release being published.
    
    Typically, GitHub marks "latest" versions "based on semver"[1], but
    GitHub
    still marks "pre-release versions" (as defined by Semver 2.0 [2]) as
    "latest" irregardless of that meaning to semver.
    
    This seems a bit unexpected, but it is the way it is, so we'll account
    for
    it by making sure we're explicit.
    
    [1]:
    https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#:~:text=the%20latest%20release%20label%20will%20automatically%20be%20assigned%20based%20on%20semantic%20versioning
    [2]: https://semver.org/#spec-item-9
    
    Follows-up: #3003 (root-cause)
    
    ---------
    
    Co-authored-by: Jeremy Lempereur <jeremy.lempereur@iomentum.com>
    abernix and o0Ignition0o committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    f9ec392 View commit details
    Browse the repository at this point in the history
  3. improved error message to address issue #2941 (#2955)

    improved error message for missing query string in GET request, to
    address issue #2941
    Fixes #2941
    
    Co-authored-by: Jesse Rosenberger <git@jro.cc>
    kushal-93 and abernix committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    1addfdc View commit details
    Browse the repository at this point in the history
  4. Fix compression for deferred responses (#2986)

    We replace tower-http's `CompressionLayer` with a custom stream transformation. This is necessary because tower-http uses async-compression, which buffers data until the end of the stream to then write it, ensuring a better compression. This is incompatible with the multipart protocol for `@defer`, which requires chunks to be sent as soon as possible. So we need to compress them independently.
    
    This extracts parts of the codec module of async-compression, which so far is not public, and makes a streaming wrapper above it that flushes the compressed data on every response in the stream.
    
    This is expected to be temporary, as we have in flight PRs for async-compression:
    - Nullus157/async-compression#155
    - Nullus157/async-compression#178
    
    With Nullus157/async-compression#150 we might be able to at least remove the vendored code
    Geal committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    56f121e View commit details
    Browse the repository at this point in the history
  5. fix(telemetry): limit the memory usage of apollo telemetry exporter (#…

    …3006)
    
    Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
    bnjjj committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    dc252df View commit details
    Browse the repository at this point in the history
  6. Time-based forced hot-reload for chaos testing (#2988)

    The Router can now artificially be made to hot-reload (as if the
    configuration or schema had changed) at a configured time interval. This
    can help reproduce issues like reload-related memory leaks.
    
    The new configuration section for chaos testing is marked as
    experimental.
    
    <!-- start metadata -->
    
    **Checklist**
    
    Complete the checklist (and note appropriate exceptions) before a final
    PR is raised.
    
    - [ ] Changes are compatible[^1]
    - [ ] Documentation[^2] completed
    - [ ] Performance impact assessed and acceptable
    - Tests added and passing[^3]
        - [ ] Unit Tests
        - [ ] Integration Tests
        - [ ] Manual Tests
    
    **Exceptions**
    
    *Note any exceptions here*
    
    **Notes**
    
    [^1]. It may be appropriate to bring upcoming changes to the attention
    of other (impacted) groups. Please endeavour to do this before seeking
    PR approval. The mechanism for doing this will vary considerably, so use
    your judgement as to how and when to do this.
    [^2]. Configuration is an important part of many changes. Where
    applicable please try to document configuration examples.
    [^3]. Tick whichever testing boxes are applicable. If you are adding
    Manual Tests:
    - please document the manual testing (extensively) in the Exceptions.
    - please raise a separate issue to automate the test and label it (or
    ask for it to be labeled) as `manual test`
    
    ---------
    
    Co-authored-by: Bryn Cooke <BrynCooke@gmail.com>
    SimonSapin and BrynCooke committed Apr 27, 2023
    Configuration menu
    Copy the full SHA
    95cceb4 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2023

  1. Re-structure the rhai logging output (#2975)

    The Rhai logging output was "standardized" about a year ago. Since that
    time, significant efforts have been made within the rest of the router
    to standardize on a slightly different format. This PR brings rhai log
    output into line with the rest of the router.
    
    It also addresses the requirement to make the "message" output
    specifiable by the script author.
    
    Note: The changes are source code compatible, but the format of the
    output log line is changing. I don't think we make compatibility
    commitments on this, but it's worth noting.
    
    Fixes #2777 
    
    <!-- start metadata -->
    
    **Checklist**
    
    Complete the checklist (and note appropriate exceptions) before a final
    PR is raised.
    
    - [ ] Changes are compatible[^1]
    - [x] Documentation[^2] completed
    - [x] Performance impact assessed and acceptable
    - Tests added and passing[^3]
        - [x] Unit Tests
        - [x] Integration Tests
        - [ ] Manual Tests
    
    **Exceptions**
    
    *Note any exceptions here*
    
    **Notes**
    
    [^1]. It may be appropriate to bring upcoming changes to the attention
    of other (impacted) groups. Please endeavour to do this before seeking
    PR approval. The mechanism for doing this will vary considerably, so use
    your judgement as to how and when to do this.
    [^2]. Configuration is an important part of many changes. Where
    applicable please try to document configuration examples.
    [^3]. Tick whichever testing boxes are applicable. If you are adding
    Manual Tests:
    - please document the manual testing (extensively) in the Exceptions.
    - please raise a separate issue to automate the test and label it (or
    ask for it to be labeled) as `manual test`
    garypen committed May 2, 2023
    Configuration menu
    Copy the full SHA
    ebd7908 View commit details
    Browse the repository at this point in the history
  2. Also support "preview" features, in addition to "experimental" featur…

    …es (#2960)
    
    This expands on the existing mechanism that was originally introduced in
    #2242, which supports the
    notion of an "experimental" feature, and make it compatible with the
    notion of "preview" features.
    
    **Checklist**
    
    Complete the checklist (and note appropriate exceptions) before a final
    PR is raised.
    
    - [x] Changes are compatible[^1]
    - [x] Documentation[^2] completed
    - [-] Performance impact assessed and acceptable
    - Tests added and passing[^3]
        - [-] Unit Tests
        - [x] Integration Tests
        - [x] Manual Tests
    
    ---------
    
    Co-authored-by: o0Ignition0o <jeremy.lempereur@gmail.com>
    Co-authored-by: Simon Sapin <simon@apollographql.com>
    3 people committed May 2, 2023
    Configuration menu
    Copy the full SHA
    44f9a26 View commit details
    Browse the repository at this point in the history
  3. docs: Rename router docset (#3021)

    This (hopefully) helps clarify that this docset is specific to
    self-hosting the router as opposed to managing cloud routing via
    GraphOS.
    Stephen Barlow committed May 2, 2023
    Configuration menu
    Copy the full SHA
    207c686 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2023

  1. feat(telemetry): selectively transmit/redact subgraph ftv1 error mess…

    …ages to studio (#3011)
    
    When using subgraphs which are enabled with [Apollo Federated
    Tracing](https://www.apollographql.com/docs/router/configuration/apollo-telemetry/#enabling-field-level-instrumentation),
    the error messages within those traces will be **redacted by default**.
    
    New configuration (`tracing.apollo.errors.subgraph.all.redact`, which
    defaults to `true`) enables and disables the redaction mechanism.
    Similar configuration (`tracing.apollo.errors.subgraph.all.send`, which
    also defaults to `true`) enables and disables the entire transmission of
    the error to Studio.
    
    The error messages returned to the clients are **not** changed or
    redacted from their previous behavior.
    
    To enable sending subgraph's federated trace error messages to Studio
    **without redaction**, you can set the following configuration:
    
    ```yaml title="router.yaml"
    telemetry:
      apollo:
        errors:
          subgraph:
            all:
              send: true # (true = Send to Studio, false = Do not send; default: true)
              redact: false # (true = Redact full error message, false = Do not redact; default: true)
    ```
    
    It is also possible to configure this **per-subgraph** using a
    `subgraphs` map at the same level as `all` in the configuration, much
    like other sections of the configuration which have subgraph-specific
    capabilities:
    
    ```yaml title="router.yaml"
    telemetry:
      apollo:
        errors:
          subgraph:
            all:
              send: true
              redact: false # Disable redaction as a default.  The `accounts` service enables it below.
            subgraphs:
              accounts: # Applies to the `accounts` subgraph, overriding the `all` global setting.
                redact: true # Redact messages from the `accounts` service.
    ```
    
    By [@bnjjj](https://github.com/bnjjj) in
    #3011
    
    ---------
    
    Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
    Co-authored-by: Jesse Rosenberger <git@jro.cc>
    Co-authored-by: Bryn Cooke <BrynCooke@gmail.com>
    3 people committed May 3, 2023
    Configuration menu
    Copy the full SHA
    10b7efa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7897f81 View commit details
    Browse the repository at this point in the history
  3. prep release: v1.16.0

    abernix committed May 3, 2023
    Configuration menu
    Copy the full SHA
    60285d1 View commit details
    Browse the repository at this point in the history