-
Notifications
You must be signed in to change notification settings - Fork 299
[Error Counting] Add ID to graphql::Error #7712
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
base: dev
Are you sure you want to change the base?
Conversation
@rregitsky, please consider creating a changeset entry in |
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 2 changed, 0 removed
Build ID: 103874ef904d501652521a52 URL: https://www.apollographql.com/docs/deploy-preview/103874ef904d501652521a52 |
…efactor_PULSR_1504
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavioral changes seem good, just wondering if we can get abstract away some of the boilerplate overwriting of null IDs in tests, which seems right now a bit heavy-handed and could be more DRY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest changes look great!
…efactor_PULSR_1504
…LSR_1504' into rreg/err_count_error_refactor_PULSR_1504
Is there some background documentation/discussion on what these IDs are for, and why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a couple of comments!
We will need a “strong identity” with which errors to count / not / count / redact in each router execution layer that is maintained in the response context. This means we’ll need to mark each error with some kind of internal error id which can then be added to a list of “already counted” errors. |
…efactor_PULSR_1504 # Conflicts: # apollo-router/src/plugins/connectors/handle_responses.rs # apollo-router/src/services/layers/persisted_queries/mod.rs
This makes two major changes to
graphql::Error
:apollo_id
UUID to errors to allow us to uniquely identify Errors. These IDs are randomly generated on construction unless one is specified by the input. Its setter is private so that Error construction is forced throughnew()
where we randomly generate the ID. The getter is public throughapollo_id()
. This value is not serialized as we'd prefer not to expose the value the user. This is not for security reasons, but more because it has no value outside of the router context.Error
construction into builders. Theapollo_id
setter is private so we are forced to avoid using the constructor.Other minor, but notable changes:
apollo.router.operations.error
measurements with the_entity
path will now emit using_entity
path rather than being replaced with the entity's name. This is to prevent double counting when the error counting migration is introduced in part 3. We will attempt to fix this behavior in a fast follow.Default
trait fromError
to force a randomapollo_id
to be generatedextension_code
no longer required when building anError
as many places weren't setting one with the constructor. We can revisit making it required once all of those places have proper error codes.Part 2 of a split from #7357. Part 1 can be found here: #7699
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
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. ↩
A lot of (if not most) features benefit from built-in observability and
debug
-level logs. Please read this guidance on metrics best-practices. ↩Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩