@@ -24,6 +24,7 @@ const RELEASE = getSentryRelease(
2424) ;
2525const SENTRY_DSN = process . env . SENTRY_DSN ;
2626const SENTRY_DSN_DEV = process . env . SENTRY_DSN_DEV ;
27+ const SENTRY_DSN_PERFORMANCE = process . env . SENTRY_DSN_PERFORMANCE ;
2728/* eslint-enable prefer-destructuring */
2829
2930// This is a fake DSN that can be used to test Sentry without sending data to the real Sentry server.
@@ -101,6 +102,8 @@ function getClientOptions() {
101102 // `false`.
102103 sendClientReports : false ,
103104 tracesSampleRate : getTracesSampleRate ( sentryTarget ) ,
105+ // If we are reporting to SENTRY_DSN_PERFORMANCE, we want to ignore all errors.
106+ ignoreErrors : sentryTarget === SENTRY_DSN_PERFORMANCE ? [ / .* / u] : undefined ,
104107 transport : makeTransport ,
105108 } ;
106109}
@@ -125,12 +128,12 @@ function getTracesSampleRate(sentryTarget) {
125128 }
126129
127130 if ( flags . ci ) {
128- // Report very frequently on main branch, and never on other branches
131+ // Report more frequently on main branch, and less frequently on other branches
129132 // (Unless you use a `flags = {"sentry": {"tracesSampleRate": x.xx}}` override)
130133 if ( flags . ci . branch === 'main' ) {
131134 return 0.015 ;
132135 }
133- return 0 ;
136+ return 0.001 ;
134137 }
135138
136139 if ( METAMASK_DEBUG ) {
@@ -205,13 +208,19 @@ function getSentryEnvironment() {
205208}
206209
207210function getSentryTarget ( ) {
211+ const manifestFlags = getManifestFlags ( ) ;
212+
208213 if (
209214 process . env . IN_TEST &&
210- ( ! SENTRY_DSN_DEV || ! getManifestFlags ( ) . sentry ?. forceEnable )
215+ ( ! SENTRY_DSN_DEV || ! manifestFlags . sentry ?. forceEnable )
211216 ) {
212217 return SENTRY_DSN_FAKE ;
213218 }
214219
220+ if ( manifestFlags . ci ?. enabled && SENTRY_DSN_PERFORMANCE ) {
221+ return SENTRY_DSN_PERFORMANCE ;
222+ }
223+
215224 if ( METAMASK_ENVIRONMENT !== 'production' ) {
216225 return SENTRY_DSN_DEV ;
217226 }
0 commit comments