René's URL Explorer Experiment


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

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@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-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5885051f-ce55-3870-94d0-96beae47f853
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8C1E:1E56CD:12A329:19469E:6B04B1A2
html-safe-nonce864e2b63b4b05104556e298a15b091df0cdc6178992df07d58796d263124950b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzFFOjFFNTZDRDoxMkEzMjk6MTk0NjlFOjZCMDRCMUEyIiwidmlzaXRvcl9pZCI6IjExNDE1MTExOTU2MzYwNTIzODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5ee4d0e81969a98d7db7e7819b71d2c749babab53657e53bdd465ca325f0699a
hovercard-subject-tagissue:2181562845
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/11046/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4e62998c1ff9b8aa08d6fb6211ed56a6e889337f4bb707ee18896e3c0fdc849e/getsentry/sentry-javascript/issues/11046
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4e62998c1ff9b8aa08d6fb6211ed56a6e889337f4bb707ee18896e3c0fdc849e/getsentry/sentry-javascript/issues/11046
og:image:altJust 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:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelforst
hostnamegithub.com
expected-hostnamegithub.com
Nonef1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/11046#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F11046
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F11046
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/11046
Reloadhttps://github.com/getsentry/sentry-javascript/issues/11046
Reloadhttps://github.com/getsentry/sentry-javascript/issues/11046
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues333 (333)https://github.com/getsentry/sentry-javascript/issues
Pull requests49 (49)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/11046
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/11046
Problems with Next.js SDK + OTELhttps://github.com/getsentry/sentry-javascript/issues/11046#top
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Package-Meta: OpenTelemetryhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package-Meta%3A%20OpenTelemetry%22
https://github.com/lforst
lforsthttps://github.com/lforst
on Mar 12, 2024https://github.com/getsentry/sentry-javascript/issues/11046#issue-2181562845
feat(opentelemetry): Do not capture exceptions for timed events #11221https://github.com/getsentry/sentry-javascript/pull/11221
[Next.js] Use OTEL for Vercel Edge SDK #13740https://github.com/getsentry/sentry-javascript/issues/13740
require-in-the-middle is resolved to import-in-the-middle and crashing with turbopack vercel/next.js#64022https://github.com/vercel/next.js/issues/64022
fix: Don't use require to load package.json files open-telemetry/opentelemetry-js#4593https://github.com/open-telemetry/opentelemetry-js/pull/4593
[Next.js] Use OTEL for Vercel Edge SDK #13740https://github.com/getsentry/sentry-javascript/issues/13740
14.0.1-canary.1https://github.com/vercel/next.js/releases/tag/v14.0.1-canary.1
OpenTelemetry: propagate a configured context(s) to root requests vercel/next.js#57084https://github.com/vercel/next.js/pull/57084
AbhiPrasadhttps://github.com/AbhiPrasad
Package: Nextjshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package%3A%20Nextjs%22
on Mar 13, 2024https://github.com/getsentry/sentry-javascript/issues/11046#event-12097130003
https://github.com/s1gr1d
s1gr1dhttps://github.com/s1gr1d
on Apr 5, 2024https://github.com/getsentry/sentry-javascript/issues/11046#issuecomment-2039808071
based on this PRhttps://github.com/getsentry/sentry-javascript/pull/11304
v14.0.1-canary.1https://github.com/vercel/next.js/releases/tag/v14.0.1-canary.1
https://private-user-images.githubusercontent.com/32902192/320010790-fccf853a-8d6f-42c8-a1e6-24b670f2eb6c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTU0NzAwMzIsIm5iZiI6MTc5NTQ2OTczMiwicGF0aCI6Ii8zMjkwMjE5Mi8zMjAwMTA3OTAtZmNjZjg1M2EtOGQ2Zi00MmM4LWExZTYtMjRiNjcwZjJlYjZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIzVDIxMzUzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJiZjc5Y2E2Y2ZiNTA2ZGQzNjRiMDdhY2JjMWVmMDc0MmY3YjAzMjk0NWU3YzQ1YjJjNGM5NWRlN2UzMmUyNTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.7FSfAfCf-3Ia--WChsUcbsVx4z51UcpK90ME2FFwYdc
https://private-user-images.githubusercontent.com/32902192/320010981-061bb060-cee0-4c78-8d08-5d0ff0d810cd.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTU0NzAwMzIsIm5iZiI6MTc5NTQ2OTczMiwicGF0aCI6Ii8zMjkwMjE5Mi8zMjAwMTA5ODEtMDYxYmIwNjAtY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xMWI1ZWM5YWRlNDg2NTdlNWEwODk4MzI3ZmE5NmYyOTkyMzMyNjc2OTk0MTZlOTVlNzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.sy6NAz8FiPP7x01H4iEuCsAt1JYCqw5YF4sWyDxv2Ec
AbhiPrasadhttps://github.com/AbhiPrasad
Package-Meta: OpenTelemetryhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package-Meta%3A%20OpenTelemetry%22
on Apr 24, 2024https://github.com/getsentry/sentry-javascript/issues/11046#event-12596152220
lforsthttps://github.com/lforst
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 20, 2024https://github.com/getsentry/sentry-javascript/issues/11046#event-14338998041
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Aug 12, 2025https://github.com/getsentry/sentry-javascript/issues/11046#event-19124770300
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/11046
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/11046
Bughttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Bug%22
Package-Meta: OpenTelemetryhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Package-Meta%3A%20OpenTelemetry%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.