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

Helm: If there are extraLabels add them to all resources #3622

Merged
merged 84 commits into from
Sep 12, 2023

Conversation

garypen
Copy link
Contributor

@garypen garypen commented Aug 21, 2023

This extends the functionality of extraLabels so that, if they are defined, they will be templated for all resources created by the chart.

Previously, they were only templated onto the Deployment resource.

This extends the functionality of `extraLabels` so that, if they are
defined, they will be templated for all resources created by the chart.

Previously, they were only templated onto the Deployment resource.
They were completely missing previously, labels and extraLabels.
@garypen garypen requested a review from a team August 21, 2023 12:26
@garypen garypen self-assigned this Aug 21, 2023
@github-actions

This comment has been minimized.

@router-perf
Copy link

router-perf bot commented Aug 21, 2023

CI performance tests

  • step - Basic stress test that steps up the number of users over time
  • events_without_dedup - Stress test for events with a lot of users and deduplication DISABLED
  • xlarge-request - Stress test with 10 MB request payload
  • xxlarge-request - Stress test with 100 MB request payload
  • 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
  • const - Basic stress test that runs with a constant number of users
  • reload - Reload test over a long period of time at a constant rate of users
  • large-request - Stress test with a 1 MB request payload
  • events - Stress test for events with a lot of users and deduplication ENABLED
  • step-jemalloc-tuning - Clone of the basic stress test for jemalloc tuning
  • no-graphos - Basic stress test, no GraphOS.

Copy link
Contributor

@BrynCooke BrynCooke left a comment

Choose a reason for hiding this comment

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

Approved, but to any docs need updating?

bryn and others added 14 commits September 12, 2023 11:36
… is now fixed.

In addition, logic that would have printed to stderr has been removed, and instead metrics values and attributes that are the wrong type are now silently ignored.

Fixes #3687
Metrics attributes were being coerced to strings. This is now fixed.
In addition, the logic around types accepted as metrics attributes has been simplified. It will log and ignore values of the wrong type.

Fixes #3691
…ally a metric being handled.

To make this work metric attributes MUST be declared after the metric value. This is checked via a cheap boolean indicating if we have already ignored attributes upton metric initialization.

Fixes #3691
Previously uplink requests created a new reqwest client each time, this
may cause CPU spikes especially on OSX.

Fixes #3333

<!-- 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 <[email protected]>
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [router-bridge](https://www.apollographql.com/apollo-federation/)
([source](https://togithub.com/apollographql/federation)) | dependencies
| patch | `=0.5.3+v2.5.3` -> `=0.5.4+v2.5.3` |

---

### 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 becomes conflicted, or you tick the
rebase/retry checkbox.

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

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/apollographql/router).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40My4yIiwidXBkYXRlZEluVmVyIjoiMzYuNjguMSIsInRhcmdldEJyYW5jaCI6ImRldiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Geoffroy Couprie <[email protected]>
Co-authored-by: Maria Elisabeth Schreiber <[email protected]>
Co-authored-by: Edward Huang <[email protected]>
o0Ignition0o and others added 24 commits September 12, 2023 11:36
Metrics attributes were being coerced to strings. This is now fixed.
In addition, the logic around types accepted as metrics attributes has
been simplified. It will log and ignore values of the wrong type.

Fixes: #3687

<!-- 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 <[email protected]>
Update rust toolchain to 1.72.0
Fix #3554

This creates a new metric recorded only if we set the configuration
option `telemetry.metrics.common.experimental_cache_metrics.enabled` to
`true`.

* `apollo.router.operations.entity` (histogram): cache hit ratio per
subgraph and entity type

This simulates an entity cache to find out if it would be useful. Each
time we do a subgraph query, we use as cache key:
- subgraph name
- entity type
- query
- vary headers
- entity key

We record if we have seen this entity before (using a bloom filter) and
calculate the cache hit ratio for that query, per subgraph and entity
type.

---------

Signed-off-by: Benjamin Coenen <[email protected]>
Co-authored-by: Benjamin Coenen <[email protected]>
there was always one additional clone before, even when the entity was
used in only one place. In local benchmarks, I could see this remove
200μs from a query
The crate is unmaintained, and the standard library has equivalent
functionality since Rust 1.70.0

* https://github.com/apollographql/router/security/dependabot/68 
* https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html


Co-authored-by: Geoffroy Couprie <[email protected]>
Currently apollo metrics may have the same metadata between multiple
routers. This means that we can't disambiguate when multiple routers are
sending data.

Add a random UUID to the metadata.

This has no user facing impact.


Note: there is no unit test or integration test for this. We need to
take a broader look at how we do telemetry testing, and the solution
should probably involve otel collector. However that is beyond the scope
of this ticket.


<!-- 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 <[email protected]>
Co-authored-by: Brandt Kinzle <[email protected]>
…s it's documented (#3773)

`subscription.enable_deduplication` was documented to be `true` by
default but it wasn't really the case.

---------

Signed-off-by: Benjamin Coenen <[email protected]>
Co-authored-by: Jeremy Lempereur <[email protected]>
This adds logging for query validation errors with either Rust or JS
when there is a mismatch, i.e. one of them validates but the other does
not. In other cases we are not really interested in the specific error
(it will just go back to the user), so we don't need to log there.

To log the Rust validation error well, I now store the ApolloDiagnostics
that were produced on `Query{}`. `Query` is serializable for caching,
but ApolloDiagnostic is not. Here I just skipped serializing
`ApolloDiagnostic` so if `Query` is loaded from cache, it does not have
the validation error stored. I'm not sure this is the right thing to do.
The ApolloDiagnostics are later used after query planning (which may
produce a JS validation error). So it's correct if we can ~safely assume
that we only have valid Query instances cached. Otherwise we might get
spurious error logs from this.
- [ ] So is that a safe assumption? Reading the CachingQueryPlanner
implementation I think it does only store errors (then it's not a
`Query` instance) and fully successful planning (then it has run both
Rust and JS validation already). So it looks fine, but it could be a bit
brittle to rely on this.

I also simplified the validation error printing which
- [x] depends on apollographql/apollo-rs#630.
- [x] and on #3675

<!-- 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`
Fix typos:
* timout->timeout
* filtered->authorization.filtered
* needs_authenticated->authorization.authenticated
* needs_requires_scopes->authorization.requires_scopes


<!-- 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 <[email protected]>
…ression and APQ (#3735)

Fix #3608

The router now adds SigningParams to the private context, which the
subgraph service can use to sign http calls before the HTTP fetch is
made (for websocket connection and regular http calls)
)

Followup to #3718, this changeset makes sure we're able to generate the
most concrete selection set for a given operation.

This means finding the most concrete type we can when we're dealing with
interfaces:
- If InterfaceA implements InterfaceB, use InterfaceA as current_type to
generate an inline fragment's selection set
  
Given the following invariants:
```graphql
  interface OperationItemStuff implements OperationItem
```

For
```graphql
fragment OperationItemFragment on OperationItem {
  ... on OperationItemStuff {
     stuff
  }
}
```

The most concrete interface to generate fields for `OperationItemStuff`
is not `OperationItem`, so we narrow down the selection to
`OperationItemStuff`.

The fixes for #3718 still apply, IE:

Given the following invariants:
```graphql
  type Dog implements Animal
```
For
```graphql
...on Animal {
  id
  ...on Dog {
    name
  }
}
```
The most concrete type to generate a selection set for `Dog` is not
`Animal`, so we narrow down the selection to `Dog`.
- In Rhai, it is `request[.subgraph].body.extensions`, the example was
missing the `.body`
- Fix link to rhai example for forwarding headers
This corrects the CHANGELOG entry for #3586 which inadvertently
suggested using `<your_graph_variant>` twice instead of
`<your_graph_id>` and (separately) `<your_graph_variant>`:

```
https://studio.apollographql.com/graph/<your_graph_id>/variant/<your_graph_variant>/operations?query=<apollo_operation_id>
```

This doesn't replace the need to document this in
#3803. 😄
The documentation for the helm chart will be generated at release time
and will include the updated comment.
@garypen garypen requested a review from a team as a code owner September 12, 2023 10:36
@garypen
Copy link
Contributor Author

garypen commented Sep 12, 2023

Approved, but to any docs need updating?

Good catch. I've updated the comment in the values.yaml file to address the change: a791fdd

@garypen garypen merged commit 38be5e2 into dev Sep 12, 2023
1 check passed
@garypen garypen deleted the garypen/helm-extra-labels branch September 12, 2023 11:01
@lrlna lrlna mentioned this pull request Sep 27, 2023
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.