Skip to content

Populate attributes for the Next.js insights page for Turbopack #16215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lforst opened this issue May 7, 2025 · 1 comment
Open

Populate attributes for the Next.js insights page for Turbopack #16215

lforst opened this issue May 7, 2025 · 1 comment

Comments

@lforst
Copy link
Member

lforst commented May 7, 2025

Description

We require two attributes on certain spans for the Next.js insights page:

  • sentry.nextjs.function.type (for example "Page", "Layout", "generateMetadata")
  • sentry.nextjs.function.route (for example "/foo/bar/[id]/page" or "/foo/bar/[id]/layout)

The spans that should have these attributes are the default export functions for Page, Layout, etc. files, and all generation functions.

This probably just involves taking spans emitted by Next.js and transforming them to have the right attributes.

@lforst
Copy link
Member Author

lforst commented May 14, 2025

So what's the actual todo here?

The attributes I was talking about in the issues are currently put on spans a) for the default functions exported from page.ts, layout.ts etc. b) for generation functions exported by page.ts, layout.ts etc. e.g generateMetadata. Since we currently create these spans via our Webpack-based wrappings, we need to find equivalents to these spans in the spans emitted by Next.js itself, so that we emit useful spans when people switch over to Turbopack. If we find that Next.js doesn't emit such spans (I honestly forgot whether it does or not), we either need to find a way to create these spans ourselves (which is likely gonna be very hard to impossible), or we need to contribute these to Next.js itself. Afterwards, we can add the relevant attributes to these spans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant