Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🥅 Tunnel browser Sentry events through a same-origin route (#3556)

Luke Vella87c28be91c1e
diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts
index 2940f7b46..57199aa9e 100644
--- a/apps/web/next.config.ts
+++ b/apps/web/next.config.ts
@@ -184,11 +184,10 @@ const sentryWebpackPluginOptions = {
// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,
- // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
- // This can increase your server load as well as your hosting bill.
- // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
- // side errors will fail.
- // tunnelRoute: "/monitoring",
+ // Routes browser events through a same-origin rewrite so ad blockers don't
+ // drop them. A fixed path rather than `true` because the proxy matcher in
+ // src/proxy.ts must exclude it, and `true` picks a new path every build.
+ tunnelRoute: "/z1tk88rw",
// Hides source maps from generated client bundles
hideSourceMaps: true,
diff --git a/apps/web/src/proxy.ts b/apps/web/src/proxy.ts
index bc1c6e443..cf254874d 100644
--- a/apps/web/src/proxy.ts
+++ b/apps/web/src/proxy.ts
@@ -77,7 +77,8 @@ export const proxy = async (req: NextRequest) => {
// `/v1` is the public API on the API host: next.config rewrites it to
// `/api/v1`, and that rewrite only runs when this proxy does not claim the
// request first. Without the exclusion the locale rewrite sends it to the
-// not-found route.
+// not-found route. `/z1tk88rw` is the Sentry tunnel (`tunnelRoute` in
+// next.config.ts) and is excluded for the same reason.
export const config = {
- matcher: ["/((?!api|v1|_next/static|_next/image|static|.*\\.).*)"],
+ matcher: ["/((?!api|v1|z1tk88rw|_next/static|_next/image|static|.*\\.).*)"],
};