From 428c926d97a6c0345bfe48d7d86c5550d7ff24d1 Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Mon, 9 Mar 2026 11:00:26 +0100 Subject: [PATCH] increase sentry pageload sample rate to 10% for reliable web vitals --- instrumentation-client.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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",