diff --git a/app/assets/javascripts/sentry/init_sentry.js b/app/assets/javascripts/sentry/init_sentry.js index d251d30eefeb6c1af10d1d1305b87acf4e057ac3..580fa8451c308c7605bf7e96935cdf7e6956420a 100644 --- a/app/assets/javascripts/sentry/init_sentry.js +++ b/app/assets/javascripts/sentry/init_sentry.js @@ -25,6 +25,12 @@ const initSentry = () => { environment: gon.sentry_environment, autoSessionTracking: true, + ignoreErrors: [ + // Network errors create noise in Sentry and can't be fixed, ignore them. + /Network Error/i, + /NetworkError/i, + ], + // Browser tracing configuration enableTracing: true, tracePropagationTargets: [/^\//], // only trace internal requests diff --git a/spec/frontend/sentry/init_sentry_spec.js b/spec/frontend/sentry/init_sentry_spec.js index c6ff0ec0a4b79bf338251ec8bdaa4cfd6d3b52d5..c51e2de27a24a3d9ad63f57a95e72bd364ef0374 100644 --- a/spec/frontend/sentry/init_sentry_spec.js +++ b/spec/frontend/sentry/init_sentry_spec.js @@ -67,6 +67,7 @@ describe('SentryConfig', () => { allowUrls: [mockGitlabUrl, 'webpack-internal://'], environment: mockEnvironment, autoSessionTracking: true, + ignoreErrors: [/Network Error/i, /NetworkError/i], enableTracing: true, tracePropagationTargets: [/^\//], tracesSampleRate: mockSentryClientsideTracesSampleRate,