-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
FeaturePackage: browserIssues related to the Sentry Browser SDKIssues related to the Sentry Browser SDK
Description
Description
follow up to #18921 (comment)
Right now we make use of addHistoryInstrumentationHandler, which listens on the popstate event listener. This works fine, but when tracing is enabled client.on('startNavigationSpan') is more granular for specific libraries, such as reactrouter:
sentry-javascript/packages/react/src/reactrouter.tsx
Lines 174 to 181 in c45eae4
| startBrowserTracingNavigationSpan(client, { | |
| name, | |
| attributes: { | |
| [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation', | |
| [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.navigation.react.${instrumentationName}`, | |
| [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source, | |
| }, | |
| }); |
With the client.on approach, there might be 2 problems:
- There won't be any
fromanymore. So in case we would implement a function to exclude certain routes, we would only have thetoparameter in a slightly different format - If my research is correct, we might have receive 1 more session, as we don't skip the first transaction (as there is a
from !== undefined, which would be the first navigation):if (from !== undefined && from !== to) {
Metadata
Metadata
Assignees
Labels
FeaturePackage: browserIssues related to the Sentry Browser SDKIssues related to the Sentry Browser SDK