-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ability to ignore all network/fetch/xhr errors #6376
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
Comments
Hi @androidacy-user, thanks for writing in! The issue of network error and other errors without stack traces has come up before (#4146, #5334). Would you mind adding your thoughts to #5334 so we can track this in one thread? As for better ignoring these errors within the SDK, I'm afraid that it is not trivial to do so reliably. We've spent considerable time a few months ago investigating errors without stack traces and so far haven't had much success. For your specific case, have you noticed any patterns apart from error message and (lack of) stack traces that these errors share? For instance, users recently experienced an influx in errors from a few specific IP addresses (#6287). Also, would you mind telling me, which problems you're facing in |
Both but currently SaaS, but on self hosted we don't have to pay $200/mo for server side filtering :) SDK is browser tracing. The beforeSend: function (event, hint) {
const error = hint.originalException
// Filter out all network, fetch, and xhr errors
if (error instanceof Error) {
if (error.message.match(/Network Error/i) || error.message.match(/Fetch Error/i) || error.message.match(/XHR Error/i) || error.message.match(/adsbygoogle/i) || error.message.match(/Failed to fetch/i)) {
return null
} else {
// Show a feedback dialog to the user
Sentry.showReportDialog({
eventId: event.event_id,
title: 'Oops! Something went wrong',
subtitle: 'We have been notified of this issue and will fix it as soon as possible.',
subtitle2: 'If you would like to help us fix this issue, please provide us with some additional information.',
labelName: 'Name',
labelEmail: 'Email',
labelComments: 'Comments',
labelClose: 'Close',
labelSubmit: 'Submit',
errorGeneric: 'An error occurred. Please try again later.'
})
return event
}
} else {
return event
}
} It filters out some but we still get a lot of |
This is especially annoying as up to 60% of our users use adblockers which cause a whole lot of fetch errors. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Not trying to be pushy but any further response? |
Hi @androidacy-user, apologies for the late reply! Your
You can do something about this by specifiying the Does this mitigate the problem for you? |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Although this mitigates one side of the problem, we still have to conduct some witchcraft with regexes and |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Anything else to add? |
One other note, you may also be able to use the So you should be able to do: Sentry.init({
ignoreErrors: [
/Network Error/i,
/Fetch Error/i,
// ...
]
}) This is functionally pretty much the same as |
has the same shortfalls however |
Problem Statement
Our sentry issue feed is chock full of "Failed to fetch" and "A NetworkError has occurred" and more. Some of it we're able to filter out using an overcomplicated event filter on
beforeSend
, however, still the spam continues.Solution Brainstorm
A native option to ignore network errors as they are almost always useless anyway.
The text was updated successfully, but these errors were encountered: