Title: Ensure browser traceId lifetime works as expected · Issue #11599 · getsentry/sentry-javascript · GitHub
Open Graph Title: Ensure browser traceId lifetime works as expected · Issue #11599 · getsentry/sentry-javascript
X Title: Ensure browser traceId lifetime works as expected · Issue #11599 · getsentry/sentry-javascript
Description: Problem Statement In v7, traces in browser SDKs had a bit of a weird lifetime and behavior: We created new traces for pageload and navigation transactions as well as for custom (user-created) transactions by default. Due to "Tracing w/o ...
Open Graph Description: Problem Statement In v7, traces in browser SDKs had a bit of a weird lifetime and behavior: We created new traces for pageload and navigation transactions as well as for custom (user-created) trans...
X Description: Problem Statement In v7, traces in browser SDKs had a bit of a weird lifetime and behavior: We created new traces for pageload and navigation transactions as well as for custom (user-created) trans...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/11599
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Ensure browser traceId lifetime works as expected","articleBody":"### Problem Statement\r\n\r\nIn v7, traces in browser SDKs had a bit of a weird lifetime and behavior:\r\n- We created new traces for pageload and navigation transactions as well as for custom (user-created) transactions by default.\r\n- Due to \"Tracing w/o Performance\" and the introduction of the propagation context, we'd attach traceIds to outgoing requests or non-transaction Sentry events that used a fallback traceId. This traceId would remain valid over the entire host application lifecycle (i.e. until a hard page reload and across browser navigations/URL changes/history changes). This resulted in \"orphaned\" traces where the fallback trace would potentially collect 100s of events that had nothing to do with each other.\r\n\r\nWith v8, we're changing the validity and lifetime of a single trace: It'll remain consistent and valid _per route_. This means:\r\n\r\n- on initial pageleoad, we create a new propagation context (i.e. traceId) and keep it valid, even when the pageload root span ended. \r\n- on subsequent browser-based navigations, we update the propagation context and keep it valid, even when the navigation root span ended.\r\n- All events happening within one _route_ (i.e. URL state, browser history state, SPA route, etc) are associated with the trace from the propagation context. This means, the fallback trace from v7 should no longer exist and \"orphaned\" events/requests should always be associated with the _last_ pageload or navigation trace. \r\n\r\n### Solution Brainstorm\r\n\r\nWe already did most of the work in https://github.com/getsentry/sentry-javascript/issues/11377 but identified a lack of tests to cover scenarios. This issue tracks all scenarios we should test as well as potential issues we identify and fix along the way.\r\n\r\n```[tasklist]\r\n### Scenarios\r\n- [x] multiple subsequent navigations have different traceIds (via https://github.com/getsentry/sentry-javascript/pull/11401)\r\n- [x] pageload and subsequent navigation have different traceIds (via #11600)\r\n- [x] error after pageload has pageload traceId (via #11600)\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11601\r\n- [x] error during navigation has navigation traceId (https://github.com/getsentry/sentry-javascript/pull/11610)\r\n- [x] error during pageload has pageload traceId (https://github.com/getsentry/sentry-javascript/pull/11610)\r\n- [x] outgoing fetch requests have correct traceId (https://github.com/getsentry/sentry-javascript/pull/11614)\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11622\r\n- [x] outgiong xhr requests have correct traceid (https://github.com/getsentry/sentry-javascript/pull/11624)\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11636\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11660\r\n- [x] [BLOCKED] feedback events have correct traceId (https://github.com/getsentry/sentry-javascript/pull/11626)\r\n```\r\n```[tasklist]\r\n### Fixes\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11600\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11631\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/11679\r\n```\r\n","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2024-04-15T10:42:53Z","url":"https://github.com/getsentry/sentry-javascript/issues/11599"}
| 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:57f87d8b-f0e6-5329-0d79-87c96dd1fee9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9CF6:2BE37C:1B1F381:2379B57:6B040A75 |
| html-safe-nonce | 0ef253eb450923a17c661444d7422469916aa0cfe6dceca3a1d55953bc58a56e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0Y2OjJCRTM3QzoxQjFGMzgxOjIzNzlCNTc6NkIwNDBBNzUiLCJ2aXNpdG9yX2lkIjoiMTA5MTczNDk4NTY5MTYzMDE5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cb9079726509fbf91c2b0ff6c635ade20319233283431793bd686784e4050fe0 |
| hovercard-subject-tag | issue:2243332033 |
| 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/11599/issue_layout |
| twitter:image | https://opengraph.githubassets.com/504e684a6cca4d9a2fe77d6fddb4b42c0cc5edcf2574d3dbe40d1a42c97bc5c5/getsentry/sentry-javascript/issues/11599 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/504e684a6cca4d9a2fe77d6fddb4b42c0cc5edcf2574d3dbe40d1a42c97bc5c5/getsentry/sentry-javascript/issues/11599 |
| og:image:alt | Problem Statement In v7, traces in browser SDKs had a bit of a weird lifetime and behavior: We created new traces for pageload and navigation transactions as well as for custom (user-created) trans... |
| 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