-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Capture certain network errors to Sentry #3423
feat: Capture certain network errors to Sentry #3423
Conversation
Bundle ReportChanges will decrease total bundle size by 385 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Bundle ReportChanges will decrease total bundle size by 385 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3423 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 809 808 -1
Lines 14239 14263 +24
Branches 3923 3933 +10
=======================================
+ Hits 14118 14142 +24
Misses 112 112
Partials 9 9
... and 3 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3423 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 809 808 -1
Lines 14239 14263 +24
Branches 3928 3940 +12
=======================================
+ Hits 14118 14142 +24
Misses 112 112
Partials 9 9
... and 3 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3423 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 809 808 -1
Lines 14239 14263 +24
Branches 3923 3933 +10
=======================================
+ Hits 14118 14142 +24
Misses 112 112
Partials 9 9
... and 3 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3423 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 809 808 -1
Lines 14239 14263 +24
Branches 3923 3933 +10
=======================================
+ Hits 14118 14142 +24
Misses 112 112
Partials 9 9
... and 3 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
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.
This is really nice and useful, thank you for putting it together!
return { hasNetworkError: true, error } | ||
} | ||
|
||
if (Object.keys(graphQLErrorToUI).includes(error.__typename)) { | ||
sendGraphQLErrorMetrics(error.__typename) |
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.
Losing out on the metrics is a bummer. Hopefully things are getting captured on the api
prometheus side
sendNetworkErrorMetrics(error.status) | ||
// only capture network errors if they are not a rate limit error | ||
// this will typically only be schema parsing errors | ||
if (error.status !== 429 && error.dev && error.error) { |
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.
Thoughts on making it easier for us in the case we forget to include both error.dev
and error.errror
and that means our errors don't get tracked? I could definitely see myself doing that. A fallback catchall fingerprint name perhaps?
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.
When you use the NetworkErrorObject
it will enforce you to add dev
to the rejection object.
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.
The only issue with having a catchall is that we're likely to catch errors that are out of our control, such as repo not activated, etc. which we don't want to be flooding Sentry with.
Description
This PR updates the
NetworkErrorBoundary
so that certain errors will be sent to Sentry so we can keep better track of them. Typically this will only be related to zod parsing errors as they're ones that we control ourselves, and it probably a good idea that we keep track of them and resolve them when able.Example Code
Notable Changes
NetworkErrorBoundary
to send certain errors to SentryNetworkErrorObject
to have conditionalerror
field