Skip to content

Commit 48b3a78

Browse files
authored
fix(nextjs): Drop _not-found spans for all HTTP methods (#13906)
POST requests and such can also emit `_not-found` transactions. We want to drop those.
1 parent 0b651ff commit 48b3a78

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/nextjs/src/server/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ export function init(options: NodeOptions): NodeClient | undefined {
242242
// Pages router
243243
event.transaction === '/404' ||
244244
// App router (could be "GET /404", "POST /404", ...)
245-
event.transaction?.match(/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH) \/404$/) ||
246-
event.transaction === 'GET /_not-found'
245+
event.transaction?.match(/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH) \/(404|_not-found)$/)
247246
) {
248247
return null;
249248
}

0 commit comments

Comments
 (0)