Skip to content

Commit 728c086

Browse files
author
Luca Forstner
committed
Increase buffer size
1 parent 7e7824c commit 728c086

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

dev-packages/e2e-tests/test-applications/nextjs-14/instrumentation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export function register() {
99
tracesSampleRate: 1.0,
1010
sendDefaultPii: true,
1111
debug: true,
12+
transportOptions: {
13+
// We are doing a lot of events at once in this test
14+
bufferSize: 1000,
15+
},
1216
});
1317
}
1418
}

dev-packages/e2e-tests/test-applications/nextjs-app-dir/instrumentation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export function register() {
99
tracesSampleRate: 1.0,
1010
sendDefaultPii: true,
1111
debug: true,
12+
transportOptions: {
13+
// We are doing a lot of events at once in this test
14+
bufferSize: 1000,
15+
},
1216
});
1317
}
1418
}

packages/nextjs/src/server/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,23 @@ export function init(options: NodeOptions): void {
115115

116116
const filterLowQualityTransactions: EventProcessor = event => {
117117
if (event.type === 'transaction') {
118-
/** This function filters transactions for requests to the Next.js static assets as those requests lead to a lot of noise in the Sentry dashboard.
119-
* By setting the next.config.js options `basePath` and `assetPrefix`, the path to the static assets might be changed.
120-
* This regex matches the default path to the static assets (`_next/static`) and could potentially filter out too many transactions.
121-
*/
122-
if (event.transaction?.match(/GET \/_next\/static\/.*/)) {
118+
// Filter out transactions for static assets
119+
// This regex matches the default path to the static assets (`_next/static`) and could potentially filter out too many transactions.
120+
// We match `/_next/static/` anywhere in the transaction name because its location may change with the basePath setting.
121+
if (event.transaction?.match(/^GET (\/.*)?\/_next\/static\//)) {
123122
return null;
124123
}
125124

125+
// Filter out transactions for requests to the tunnel route
126126
if (
127127
globalWithInjectedValues.__sentryRewritesTunnelPath__ &&
128128
event.transaction === `POST ${globalWithInjectedValues.__sentryRewritesTunnelPath__}`
129129
) {
130-
// Filter out transactions for requests to the tunnel route
131130
return null;
132-
} else if (event.transaction?.match(/\/__nextjs_original-stack-frame/)) {
133-
// Filter out requests to resolve source maps for stack frames in dev mode
131+
}
132+
133+
// Filter out requests to resolve source maps for stack frames in dev mode
134+
if (event.transaction?.match(/\/__nextjs_original-stack-frame/)) {
134135
return null;
135136
}
136137

0 commit comments

Comments
 (0)