Title: [sentry/nextjs] sentry/tracing adds 30kb, can we opt-out ? · Issue #4722 · getsentry/sentry-javascript · GitHub
Open Graph Title: [sentry/nextjs] sentry/tracing adds 30kb, can we opt-out ? · Issue #4722 · getsentry/sentry-javascript
X Title: [sentry/nextjs] sentry/tracing adds 30kb, can we opt-out ? · Issue #4722 · getsentry/sentry-javascript
Description: Problem Statement Following the sentry/nextjs recommended approach, it's difficult to opt-out from tracing in the browser. The sentry/tracing adds more or less 30kb to the browser final bundle which is a hard blocker in some circumstance...
Open Graph Description: Problem Statement Following the sentry/nextjs recommended approach, it's difficult to opt-out from tracing in the browser. The sentry/tracing adds more or less 30kb to the browser final bundle whic...
X Description: Problem Statement Following the sentry/nextjs recommended approach, it's difficult to opt-out from tracing in the browser. The sentry/tracing adds more or less 30kb to the browser final bundle ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4722
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[sentry/nextjs] sentry/tracing adds 30kb, can we opt-out ?","articleBody":"### Problem Statement\n\nFollowing the sentry/nextjs recommended approach, it's difficult to opt-out from tracing in the browser.\r\n\r\nThe sentry/tracing adds more or less 30kb to the browser final bundle which is a hard blocker in some circumstances.\r\n\r\nHere's a tree map taken with the recommended approach and tested with @sentry/nextjs 6.18.2 \r\n\r\n\r\n\r\n\r\n\n\n### Solution Brainstorm\n\nI was able to remove the sentry/tracing from the browser, by importing sentry/react rather than sentry/nextjs\r\n\r\n```typescript\r\n// import { init as sentryInit } from '@sentry/nextjs';\r\nimport { init as sentryInit } from '@sentry/react';\r\n\r\nsentryInit({\r\n dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,\r\n // tracesSampleRate: 1.0,\r\n});\r\n```\r\n\r\nThat reduced the bundle from 103kb to 73kb\r\n\r\n\r\n\r\nThe setup is https://github.com/belgattitude/nextjs-monorepo-example/pull/1409\r\n\r\nIs there any drawbacks or risks to this approach (apart from not sending traces) ?\r\n","author":{"url":"https://github.com/belgattitude","@type":"Person","name":"belgattitude"},"datePublished":"2022-03-15T14:01:47Z","url":"https://github.com/getsentry/sentry-javascript/issues/4722"}
| 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:aa6d1fae-d788-bb3a-000b-ddebf96dc10e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 907C:13A804:A274CD:E3B463:6B042F97 |
| html-safe-nonce | f4a61848ec1bf97dc672b9cf2db26e8f1f826895aa53f87bb45eeffeaf46e29d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDdDOjEzQTgwNDpBMjc0Q0Q6RTNCNDYzOjZCMDQyRjk3IiwidmlzaXRvcl9pZCI6IjE4OTgyNDg2Nzc1ODg0Nzk4OTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 28afedf0ff0bd5f90db87ebcec0a7b620b25baee924657e19960ffae625b002b |
| hovercard-subject-tag | issue:1169717420 |
| 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/4722/issue_layout |
| twitter:image | https://opengraph.githubassets.com/217653e06e2564ea967823fcabf7c30833a1ba0ab2d05d5de3f6e5cfe1025c37/getsentry/sentry-javascript/issues/4722 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/217653e06e2564ea967823fcabf7c30833a1ba0ab2d05d5de3f6e5cfe1025c37/getsentry/sentry-javascript/issues/4722 |
| og:image:alt | Problem Statement Following the sentry/nextjs recommended approach, it's difficult to opt-out from tracing in the browser. The sentry/tracing adds more or less 30kb to the browser final bundle whic... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | belgattitude |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| 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 | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| 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