Title: Problems with Next.js SDK + OTEL · Issue #11046 · getsentry/sentry-javascript · GitHub
Open Graph Title: Problems with Next.js SDK + OTEL · Issue #11046 · getsentry/sentry-javascript
X Title: Problems with Next.js SDK + OTEL · Issue #11046 · getsentry/sentry-javascript
Description: Just a collection of things I noticed when trying out the Next.js SDK with our newest OTEL implementation. This list is WIP: Findings: Next.js is creating spans by itself as soon as we call Sentry.init(). Apparently, the @vercel/otel pac...
Open Graph Description: Just a collection of things I noticed when trying out the Next.js SDK with our newest OTEL implementation. This list is WIP: Findings: Next.js is creating spans by itself as soon as we call Sentry....
X Description: Just a collection of things I noticed when trying out the Next.js SDK with our newest OTEL implementation. This list is WIP: Findings: Next.js is creating spans by itself as soon as we call Sentry....
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/11046
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Problems with Next.js SDK + OTEL","articleBody":"Just a collection of things I noticed when trying out the Next.js SDK with our newest OTEL implementation. This list is WIP:\n\nFindings:\n- Next.js is creating spans by itself as soon as we call `Sentry.init()`.\n- Apparently, the `@vercel/otel` package has support for Edge runtime fetch instrumentation. We need to try this out.\n\nProblems:\n- [x] Root spans have garbage names and will therefore pollute the Performance tab\n - ✅ Kind of solved by setting `forceTransaction: true` for our own spans.\n- [x] Not using `instrument.ts` to init the SDK will destroy parent-child relationships between Next.js spans and Sentry SDK spans. No friggin idea what is going on here.\n - ✅ Solved by forcing users to use `instrumentation.ts`\n- [x] Since Next.js now creates root spans, the root span doesn't have much data at all (No headers, no tags, no anything).\n- [x] Next.js created a lot of timed events which the SDK turned into error events\n - ✅ Solved by removing our error event deletion logic: https://github.com/getsentry/sentry-javascript/pull/11221\n- [x] Flushing on Vercel doesn't work properly for spans created by OTEL.\n\t- Apparently, there is a `waitUntil` coming in Next.js which could solve this. Right now I don't have an idea on how to fix this. I tried \nadding a SIGTERM handler, I tried adding a custom spanprocessor that flushes. Nothing works.\n - ✅ We are using the `waitUntil` successfully now\n- [x] For the time being we will still need out own auto-instrumentation for Edge API routes, and Edge Server components\n - Tracked here: https://github.com/getsentry/sentry-javascript/issues/13740\n- [x] Next.js crashes with the `--turbo` flag: https://github.com/vercel/next.js/issues/64022\n- [x] There is very weird log output when building and in the dev-server.\n - Might be fixed by: https://github.com/open-telemetry/opentelemetry-js/pull/4593\n- [x] Dev server symbolification requests start traces (needs some mechanism to opt out of tracing for edge, browser, and node)\n - ✅ We suppress tracing for those\n- [x] Edge runtime doesn't use otel yet, however we have runtime agnostic code that runs on edge and node, causing problems if we depend on Next.js creating spans, for example for API routes\n - Tracked here: https://github.com/getsentry/sentry-javascript/issues/13740\n- [x] Tracing doesn't work on Next.js 14 from version [14.0.1-canary.1](https://github.com/vercel/next.js/releases/tag/v14.0.1-canary.1), if we disable the Http integration (which we kinda have to). This PR in Next.js introduced this bug https://github.com/vercel/next.js/pull/57084\n - ✅ The `httpIntegration` doesn't work on Next.js 14. This seems to be _somewhat_ fine though since Next.js itself creates http.server spans we can use\n- [x] We need to filter server transactions for all kinds of static resources: CSS, Favicon, Fonts, ...\n - ✅ We employ a event processor\n- [x] Suspended server components seem to be breaking out of the async context of the parent server component\n - ✅ We were just ending spans before the children are finished.\n","author":{"url":"https://github.com/lforst","@type":"Person","name":"lforst"},"datePublished":"2024-03-12T12:59:17Z","url":"https://github.com/getsentry/sentry-javascript/issues/11046"}
| 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:5885051f-ce55-3870-94d0-96beae47f853 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C1E:1E56CD:12A329:19469E:6B04B1A2 |
| html-safe-nonce | 864e2b63b4b05104556e298a15b091df0cdc6178992df07d58796d263124950b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzFFOjFFNTZDRDoxMkEzMjk6MTk0NjlFOjZCMDRCMUEyIiwidmlzaXRvcl9pZCI6IjExNDE1MTExOTU2MzYwNTIzODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5ee4d0e81969a98d7db7e7819b71d2c749babab53657e53bdd465ca325f0699a |
| hovercard-subject-tag | issue:2181562845 |
| 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/11046/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4e62998c1ff9b8aa08d6fb6211ed56a6e889337f4bb707ee18896e3c0fdc849e/getsentry/sentry-javascript/issues/11046 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4e62998c1ff9b8aa08d6fb6211ed56a6e889337f4bb707ee18896e3c0fdc849e/getsentry/sentry-javascript/issues/11046 |
| og:image:alt | Just a collection of things I noticed when trying out the Next.js SDK with our newest OTEL implementation. This list is WIP: Findings: Next.js is creating spans by itself as soon as we call Sentry.... |
| 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 | f1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1 |
| 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 | ffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b |
| ui-target | full |
| 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