diff --git a/app/next.config.js b/app/next.config.js index 85a3d6b34..47b851622 100644 --- a/app/next.config.js +++ b/app/next.config.js @@ -108,5 +108,5 @@ module.exports = withPreconstruct( module.exports = withSentryConfig( module.exports, { silent: true }, - { hideSourcemaps: true, autoInstrumentServerFunctions: false } + { hideSourcemaps: true } ); diff --git a/app/sentry.client.config.js b/app/sentry.client.config.js index 4a43c6bcf..b9e9b8c71 100644 --- a/app/sentry.client.config.js +++ b/app/sentry.client.config.js @@ -11,12 +11,6 @@ Sentry.init({ environment: SENTRY_ENV, release: `visualization-tool@${BUILD_VERSION}`, tracesSampleRate: 1.0, - tracesSampler: (samplingContext) => { - // Ignore auth calls to prevent 405 Keycloak errors. - if (samplingContext.transactionContext?.name?.includes("auth")) { - return 0; - } - }, ignoreErrors: [ // The ResizeObserver error is actually not problematic // @see https://forum.sentry.io/t/resizeobserver-loop-limit-exceeded/8402 diff --git a/app/sentry.server.config.js b/app/sentry.server.config.js index 2c341253f..b4582ecb5 100644 --- a/app/sentry.server.config.js +++ b/app/sentry.server.config.js @@ -11,4 +11,14 @@ Sentry.init({ environment: SENTRY_ENV, release: `visualization-tool@${BUILD_VERSION}`, tracesSampleRate: 1.0, + instrumenter: { + patch: (mod, path, logger) => { + // Ignore auth calls to prevent 405 Keycloak errors. + if (path?.includes("auth")) { + return null; + } + + return mod; + }, + }, });