Skip to content

feat(nextjs): remove tracing from pages router API routes #18450

@github-actions

Description

@github-actions

Note

The pull request "feat(nextjs): remove tracing from pages router API routes" was created by @logaretm but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

This is a big PR because of the tests added, the logic changes themselves are pretty minimal, so make sure to filter out the files when reviewing.

Actual Changes

Removed traces from wrapApiHandlerWithSentry for both the server runtime and the edge runtime

Tests Added

Since we are dropping explicit trace wrapping logic from the pages router templates, we needed to have tests on Next 16 to make sure the page router there still works in both Turbopack and Webpack with minimal differences in the quality of the traces.

We have around 36 test case to check, but only 20 can pass at this time due to the wrapping logic still present, ideally as we move towards removing templates entirely, we can then unskip those tests and tighten many of the assertions we have to accommodate for it.

I added TODOs and a TEST_STATUS.md document to detail what we should update once the SDK drops more of the wrapping logic it currently has.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions