Title: Transaction starts after beforeEach is resolved when vueRouterInstrumentation is present · Issue #4072 · getsentry/sentry-javascript · GitHub
Open Graph Title: Transaction starts after beforeEach is resolved when vueRouterInstrumentation is present · Issue #4072 · getsentry/sentry-javascript
X Title: Transaction starts after beforeEach is resolved when vueRouterInstrumentation is present · Issue #4072 · getsentry/sentry-javascript
Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Package + Version @sentry...
Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/4072
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Transaction starts after beforeEach is resolved when vueRouterInstrumentation is present","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/vue: 6.13.3`\r\n- [x] `@sentry/tracing: 6.13.3`\r\n\r\n### Version:\r\n\r\n```\r\n@sentry/vue: 6.13.3\r\n@sentry/tracing: 6.13.3\r\n```\r\n\r\n## Description\r\n\r\nI have an XHR request on the `beforeEach` hook of Vue Router.\r\n\r\nWhen `vueRouterInstrumentation` is enabled pageload or navigation transaction starts after `beforeEach` resolved, causing the the XHR requests in beforeEach to NOT have `sentry-trace` header.\r\n\r\nWhen `vueRouterInstrumentation` is disabled, then pageload transaction starts before `beforeEach` and the request has the `sentry-trace` header present as expected.\r\n\r\nBut then when navigated to a new page, navigation transaction again starts after `beforeEach` causing requests to not be included in the transaction..\r\n\r\nSo it seems like using `vueRouterInstrumentation` takes some things away while adding some other things..\r\n\r\nIs this the intentional/expected behaviour, I'm not sure and if so, what would you suggest to solve this?\r\nFor example wouldn't it be possible to start the navigation transaction on the `beforeEach` hook?\r\n\r\nEventually my goal is to have all my api calls traced. I've to say I'm a bit surpised that automatic instrumentation does not pick up individual xhr requests unless there is an active transaction.\r\n\r\nHere's sandbox\r\nhttps://codesandbox.io/s/sentry-tracing-beforeeach-7j8g6?file=/src/main.js\r\n\r\nThanks!\r\n\r\n---\r\nUpdate:\r\n\r\nNoticed here transaction is already being started on `beforeEach` hook.\r\nhttps://github.com/getsentry/sentry-javascript/blob/master/packages/vue/src/router.ts#L36\r\n\r\nIs this the result of a merge strategy behaviour?","author":{"url":"https://github.com/laygir","@type":"Person","name":"laygir"},"datePublished":"2021-10-17T19:41:05Z","url":"https://github.com/getsentry/sentry-javascript/issues/4072"}
| 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:8cfa8cc1-9bf8-ad44-ec9e-6f31651d8532 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9756:1CE302:1ECF05:298B4D:6B04312B |
| html-safe-nonce | 3fdb0b079e2a996b84d0e1b9b98ac25efc5e85339e1b99d913dc7a6b169de78d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzU2OjFDRTMwMjoxRUNGMDU6Mjk4QjREOjZCMDQzMTJCIiwidmlzaXRvcl9pZCI6IjYxOTM3NTIwMzI3NTE2NjEzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f36fbca2e1416833fe60cfac1ac2a82baab0db2be59a0f4913aa9fe3aff66a7a |
| hovercard-subject-tag | issue:1028418834 |
| 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/4072/issue_layout |
| twitter:image | https://opengraph.githubassets.com/954c5afcaf9b811997bf906ac54582684902d5bde30e32494074e4a1adfb0a7b/getsentry/sentry-javascript/issues/4072 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/954c5afcaf9b811997bf906ac54582684902d5bde30e32494074e4a1adfb0a7b/getsentry/sentry-javascript/issues/4072 |
| og:image:alt | Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | laygir |
| 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