diff --git a/instrumentation-client.ts b/instrumentation-client.ts index 95f8d1dd4e3..36ed970a9ca 100644 --- a/instrumentation-client.ts +++ b/instrumentation-client.ts @@ -29,7 +29,14 @@ function findClosestElementId( Sentry.init({ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, - tracesSampleRate: 0.01, + tracesSampler(samplingContext) { + // 10% of pageloads for reliable Web Vitals data + if (samplingContext.attributes?.["sentry.op"] === "pageload") { + return 0.1 + } + // 1% for everything else + return 0.01 + }, debug: environment === "development", environment, enabled: environment === "production",