Title: [v8] Multiple roots detected with manual spans · Issue #12116 · getsentry/sentry-javascript · GitHub
Open Graph Title: [v8] Multiple roots detected with manual spans · Issue #12116 · getsentry/sentry-javascript
X Title: [v8] Multiple roots detected with manual spans · Issue #12116 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/12116
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v8] Multiple roots detected with manual spans","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/browser\n\n### SDK Version\n\n8.2.1\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\nhttps://codeocean.sentry.io/performance/trace/ee6b9b5549414a8f83fcd71f9f24d054/\n\n### SDK Setup\n\n```javascript\r\nSentry.init({\r\n dsn: sentrySettings.data('dsn'),\r\n attachStacktrace: true,\r\n release: sentrySettings.data('release'),\r\n environment: sentrySettings.data('environment'),\r\n autoSessionTracking: true,\r\n tracesSampleRate: 1.0,\r\n replaysSessionSampleRate: 0.0,\r\n replaysOnErrorSampleRate: 1.0,\r\n integrations: [\r\n Sentry.browserProfilingIntegration(),\r\n Sentry.browserTracingIntegration(),\r\n Sentry.extraErrorDataIntegration(),\r\n Sentry.httpClientIntegration(),\r\n Sentry.replayIntegration(),\r\n Sentry.reportingObserverIntegration(),\r\n Sentry.sessionTimingIntegration(),\r\n ],\r\n profilesSampleRate: 1.0,\r\n initialScope: scope =>{\r\n if (current_user) {\r\n scope.setUser(_.omit(current_user, 'displayname'));\r\n }\r\n return scope;\r\n }\r\n});\r\n```\n\n### Steps to Reproduce\n\nI am trying to add some custom transactions to my frontend code, allowing to gather further insights. With the previous v7 of the SDK, I was able to achieve that:\r\n\r\n\u003cimg width=\"1494\" alt=\"Bildschirmfoto 2024-05-18 um 12 46 32\" src=\"https://github.com/getsentry/sentry-javascript/assets/7300329/6511b9b0-6f0f-4580-bf3c-0a54ec5ccb63\">\r\n\r\nAs shown, the \"run\" transaction might last several seconds, and I want to have it separate for further analysis. In v7 code, I was manually starting a transaction. With v8, I am about to migrate to `Sentry.startSpanManual` with no currently active parent span, so that something formally known as \"transaction\" should be created. \r\n\r\nHowever, my new transactions always keep the same trace ID, even when trying the `forceTransaction` option (see screenshot in \"actual result\"):\r\n\r\n```javascript\r\nconst cause = initiator.data('cause') || initiator.prop('id');\r\nSentry.startSpanManual({ name: cause, op: \"transaction\", forceTransaction: true }, span => {\r\n callback(span);\r\n});\r\n```\r\n\r\nI already tried passing a new scope (similar to #12000), but without success either. Further, I am not sure what the actual expected behavior should be. When reading #11599, I got the impression that the newly observed behavior is expected (\"All events happening within _one_ route are associated with the trace from the propagation context.\"), but since the Sentry Saas UI still reports the \"multiple root transactions\" error, I am not sure about that.\n\n### Expected Result\n\nEach transaction is shown in a dedicated trace and I can decide to start a new transaction as desired. Specifically, the \"page load\" and my various \"run\" transactions are not merged together. See my above screenshot for my expectation.\n\n### Actual Result\n\nThe initial page load and my custom transactions are grouped in the same trace. Simultaneously, I get a warning about \"[Multiple root transactions have been found with this trace ID.](https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#multiple-roots)\".\r\n\r\n\u003cimg width=\"1497\" alt=\"Bildschirmfoto 2024-05-18 um 12 40 01\" src=\"https://github.com/getsentry/sentry-javascript/assets/7300329/0e2c2ada-eb9e-4e9f-ab03-5ee94535adce\">\r\n","author":{"url":"https://github.com/MrSerth","@type":"Person","name":"MrSerth"},"datePublished":"2024-05-18T10:57:31Z","url":"https://github.com/getsentry/sentry-javascript/issues/12116"}
| 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:94b3c889-0001-1bae-755a-90bd03cc25eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E42E:43FF1:2BA01D2:3841B94:6B040656 |
| html-safe-nonce | 00283fd97bf77f54d09e571d9ca9c3dbd798661311657020b19f8c359c05a29c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDJFOjQzRkYxOjJCQTAxRDI6Mzg0MUI5NDo2QjA0MDY1NiIsInZpc2l0b3JfaWQiOiI5NjU4Njg0OTk0NzYxNTM5NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a5e9bf42841037187cd2eec980fd3a7e2aab2a8653fbb7fa58c7c11ac325d5e5 |
| hovercard-subject-tag | issue:2304022125 |
| 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/12116/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e29e57264aaf45d25f8f0031fd1ccbe040413734aea30b10ed468e6d902ea016/getsentry/sentry-javascript/issues/12116 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e29e57264aaf45d25f8f0031fd1ccbe040413734aea30b10ed468e6d902ea016/getsentry/sentry-javascript/issues/12116 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MrSerth |
| 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