Skip to content

Commit

Permalink
fix(nextjs): Drop _not-found spans for all HTTP methods (#13906)
Browse files Browse the repository at this point in the history
POST requests and such can also emit `_not-found` transactions. We want
to drop those.
  • Loading branch information
lforst authored Oct 8, 2024
1 parent 0b651ff commit 48b3a78
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/nextjs/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ export function init(options: NodeOptions): NodeClient | undefined {
// Pages router
event.transaction === '/404' ||
// App router (could be "GET /404", "POST /404", ...)
event.transaction?.match(/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH) \/404$/) ||
event.transaction === 'GET /_not-found'
event.transaction?.match(/^(GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH) \/(404|_not-found)$/)
) {
return null;
}
Expand Down

0 comments on commit 48b3a78

Please sign in to comment.