Title: Trace pageloads on Next.js app router · Issue #9571 · getsentry/sentry-javascript · GitHub
Open Graph Title: Trace pageloads on Next.js app router · Issue #9571 · getsentry/sentry-javascript
X Title: Trace pageloads on Next.js app router · Issue #9571 · getsentry/sentry-javascript
Description: We would like to trace page loads for the Next.js app router. This would involve somehow passing trace data for Next.js app router SSR to the client for the initial page load. Currently, we are blocked here by React/Next.js because there...
Open Graph Description: We would like to trace page loads for the Next.js app router. This would involve somehow passing trace data for Next.js app router SSR to the client for the initial page load. Currently, we are blo...
X Description: We would like to trace page loads for the Next.js app router. This would involve somehow passing trace data for Next.js app router SSR to the client for the initial page load. Currently, we are blo...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/9571
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Trace pageloads on Next.js app router","articleBody":"We would like to trace page loads for the Next.js app router. This would involve somehow passing trace data for Next.js app router SSR to the client for the initial page load.\r\n\r\nCurrently, we are blocked here by React/Next.js because there is no real way to transparently transfer trace data to the client.\r\n\r\n---\r\n\r\n### Update (Jan 23, 2024)\r\n\r\nWe have identified a way to pass trace data from Server Components to the client for page loads. It involves using the `useServerInsertedHTML` hook. One thing that is important to know up-front is that this hook can only be used in client components (`\"use client\"`).\r\n\r\nIn an ideal world, the implementation would look as follows:\r\n\r\nWe automatically wrap all of the user's server components and make their server components render a client component which returns `null` (so we're not actually putting anything in the users page) but are calling `userServerInsertedHTML` inside to render `\u003cmeta />` tags containing `sentry-trace` and `baggage` data. The `\u003cmeta />` tag data can then be picked up by the browser SDK to continue the trace.\r\n\r\nWhat blocks us?\r\n- We need to remove the Sentry SDK from the externalized packages list in Next.js itself: It is preventing us from having client-components in the SDK.","author":{"url":"https://github.com/lforst","@type":"Person","name":"lforst"},"datePublished":"2023-11-15T13:17:58Z","url":"https://github.com/getsentry/sentry-javascript/issues/9571"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:98799e26-1bb3-ae4e-d702-049c6e427eca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA0E:285B2D:41BF5D3:5814EB9:6B040C6D |
| html-safe-nonce | 136bf6589a81c9a90e4242425cf1ecd59ee2734b7e61ca182f5abc413b485ee1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTBFOjI4NUIyRDo0MUJGNUQzOjU4MTRFQjk6NkIwNDBDNkQiLCJ2aXNpdG9yX2lkIjoiNDgzMDEwNTA5MTcwNzI0MzYyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0a3e04108a2a2c35fac21be6bcfaabc31e80491bcdd93b5776f759613b063148 |
| hovercard-subject-tag | issue:1994763671 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/9571/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f55b7fca01d135012950e970aa25b85e56cc1505e83b89e8edcf91f77e23b02/getsentry/sentry-javascript/issues/9571 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f55b7fca01d135012950e970aa25b85e56cc1505e83b89e8edcf91f77e23b02/getsentry/sentry-javascript/issues/9571 |
| og:image:alt | We would like to trace page loads for the Next.js app router. This would involve somehow passing trace data for Next.js app router SSR to the client for the initial page load. Currently, we are blo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lforst |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width