Simplify implementation of telementry's events (backport #7280)#7313
Closed
IvanGoncharov wants to merge 1 commit into1.xfrom
Closed
Simplify implementation of telementry's events (backport #7280)#7313IvanGoncharov wants to merge 1 commit into1.xfrom
IvanGoncharov wants to merge 1 commit into1.xfrom
Conversation
(cherry picked from commit e7d8e7b) # Conflicts: # apollo-router/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap # apollo-router/src/plugins/connectors/handle_responses.rs # apollo-router/src/plugins/telemetry/config_new/connector/events.rs # apollo-router/src/plugins/telemetry/config_new/events.rs # apollo-router/src/plugins/telemetry/fmt_layer.rs # apollo-router/src/plugins/telemetry/mod.rs # apollo-router/src/services/connector/request_service.rs
Contributor
|
Cherry-pick of e7d8e7b has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
6 tasks
Collaborator
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 763d2fd23660d79afc0c28b2 |
|
CI performance tests
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I made a few attempts to make minimal fixes based on #7231. However, it was extremely hard to cover all edge cases, so I decided to do a separate refactoring PR first.
The core issue is that currently, some
on_request/on_responsefunctions exit earlier:router/apollo-router/src/plugins/telemetry/config_new/events.rs
Lines 261 to 264 in 3ae5f3f
And because of it, bypass
responseand custom events:router/apollo-router/src/plugins/telemetry/config_new/events.rs
Lines 273 to 281 in 3ae5f3f
Simply removing returns and implementing logic using ifs also doesn't work:
https://github.com/apollographql/router/pull/7231/files#diff-fab80b4af0ee70850af9ac42bf7990d09912b65f75b39456c6e47ca817d4a0d2R262-R269
It results in the standard event without the condition being ignored.
Trying to address it with a more complicated condition would work, but it would require adding it to more than a dozen places and also doesn't guarantee that we don't break some other edge cases.
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
This is an automatic backport of pull request #7280 done by [Mergify](https://mergify.com).
Footnotes
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. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩