Skip to content
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

feat(nextjs): Connect server component transactions if there is no incoming trace #9845

Merged
merged 12 commits into from Dec 18, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Dec 14, 2023

Resolves #9816

With this PR we will connect the transactions of server components and generation functions for requests that do not have an incoming trace. This is usually the case for pageloads.

We do this based on a "shared object". Right now this shared object is the headers object. It has the same identity for all server components that are invoked in the context of one request.

Screenshot 2023-12-18 at 13 51 19

Copy link
Contributor

github-actions bot commented Dec 18, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 75.16 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 66.58 KB (0%)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 60.18 KB (0%)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.26 KB (0%)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 29.87 KB (0%)
@sentry/browser - Webpack (gzipped) 21.56 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 72.6 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 64.31 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 30.57 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 22.63 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 202.28 KB (0%)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 92.4 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 67.45 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 33.47 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 66.94 KB (0%)
@sentry/react - Webpack (gzipped) 21.6 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 83.72 KB (0%)
@sentry/nextjs Client - Webpack (gzipped) 48.41 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 16.18 KB (0%)

Base automatically changed from lforst-refactor-wrap-servercomponents to develop December 18, 2023 11:48
Comment on lines -160 to -161
// Remove routing groups: https://beta.nextjs.org/docs/routing/defining-routes#example-creating-multiple-root-layouts
.replace(/\/(\(.*?\)\/)+/g, '/')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sneaking this in. This is actually a bug because routing groups should part of the txn name. I added this when I didn't fully understand the app router yet.

@lforst lforst enabled auto-merge (squash) December 18, 2023 14:25
@lforst lforst merged commit f121585 into develop Dec 18, 2023
58 checks passed
@lforst lforst deleted the lforst-connect-server-component-traces branch December 18, 2023 14:41
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

Successfully merging this pull request may close these issues.

Connect Next.js Server Component invocations with a trace ID if there is no incoming trace.
2 participants