Title: Always add `browserTracingIntegration` in Meta Framework SDKs · Issue #13010 · getsentry/sentry-javascript · GitHub
Open Graph Title: Always add `browserTracingIntegration` in Meta Framework SDKs · Issue #13010 · getsentry/sentry-javascript
X Title: Always add `browserTracingIntegration` in Meta Framework SDKs · Issue #13010 · getsentry/sentry-javascript
Description: Problem Statement Currently, our meta-framework SDKs (in contrast to the frontend framework and base browser SDKs) automatically add browserTracingIntegration if: The __SENTRY_TRACING__ tree-shaking flag is not replaced at build time has...
Open Graph Description: Problem Statement Currently, our meta-framework SDKs (in contrast to the frontend framework and base browser SDKs) automatically add browserTracingIntegration if: The __SENTRY_TRACING__ tree-shakin...
X Description: Problem Statement Currently, our meta-framework SDKs (in contrast to the frontend framework and base browser SDKs) automatically add browserTracingIntegration if: The __SENTRY_TRACING__ tree-shakin...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/13010
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Always add `browserTracingIntegration` in Meta Framework SDKs","articleBody":"### Problem Statement\n\nCurrently, our meta-framework SDKs (in contrast to the frontend framework and base browser SDKs) automatically add `browserTracingIntegration` if:\n\n1. The `__SENTRY_TRACING__` tree-shaking flag is not replaced at build time\n2. `hasTracingEnabled` returns true, meaning `tracesSampleRate`, `tracesSampler` or `enableTracing` options are set\n\nThe second (2) condition unfortunately breaks \"Tracing without Performance\" which in our frontend framework SDKs is enabled as soon as `browserTracingIntegration` is added but _no_ sample rates are set. Adding to this, there is no bundle size advantage in not adding `browserTracingIntegration` because the `hasTracingEnabled` check is performed at runtime. This results in the integration code always being added to the bundle.\n\nWe realized this while working on and reviewing #13005\n\n### Solution Brainstorm\n\nWe're going to change the behaviour here to remove condition 2 entirely. Meaning, by default, `browserTracingIntegration` will always be added, unless users configure the tree shaking flag (1). This change should be implemented in all our meta framework SDKs that currently automatically add `browserTracingIntegration`.\n\nThe benefits of always adding the integration are:\n- Tracing without performance works, i.e. tracing headers are propagated to get a trace for an error but no spans are created or sent to Sentry\n- The error `transaction` field is populated via the framework's `browserTracingIntegration` setting `scope.transactionName`. This means higher quality transaction names out of the box.\n- Bundle size isn't wasted like before\n\n ### Implementation\n\nImplementing this behaviour requires two changes:\n1. Remove the `hasTracingEnabled` guard in the SDK initialization\n2. Add a higher-level option to the meta framework's build config (e.g. `sentrySvelteKit` vite plugin or Astro integration options) for users to easily opt out of tracing. This option should pass the boolean to the Sentry bundler plugin's `bundleSizeOptimizations.excludePerformanceMonitoring` option.","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2024-07-23T07:48:56Z","url":"https://github.com/getsentry/sentry-javascript/issues/13010"}
| 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:4c80a894-c275-6749-017c-3753bbdf3cb5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8FBA:28DAC6:F62217:136DB8F:6B0391F7 |
| html-safe-nonce | 47ae82e5e1f77796749e2bd697db094101f3ed6708bfa5eaf3c3f5138f7ada9d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkJBOjI4REFDNjpGNjIyMTc6MTM2REI4Rjo2QjAzOTFGNyIsInZpc2l0b3JfaWQiOiIyOTQ0MDc5NDkzNDA2NjI2Mjk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d523227cdb6e5b3a2cb3eca271e053ac7b317d57a84ec77fdfc298e6620f1e7a |
| hovercard-subject-tag | issue:2424511068 |
| 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/13010/issue_layout |
| twitter:image | https://opengraph.githubassets.com/886f186fadac043a0caa384cbd41239dfb659d11d3c2701375611ff93750db69/getsentry/sentry-javascript/issues/13010 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/886f186fadac043a0caa384cbd41239dfb659d11d3c2701375611ff93750db69/getsentry/sentry-javascript/issues/13010 |
| og:image:alt | Problem Statement Currently, our meta-framework SDKs (in contrast to the frontend framework and base browser SDKs) automatically add browserTracingIntegration if: The __SENTRY_TRACING__ tree-shakin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| 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 | 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