Skip to content

Commit e0a0009

Browse files
authored
fix(sdk): Fix sentry transactions w/ customer domains (#44984)
### Summary We started splitting our transactions after introducing customer domains as they are separate routes within the router. This normalizes transaction names against the new routes for customer domains. eg. /organizations/:orgId/performance/ becomes /performance/
1 parent aa3881e commit e0a0009

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

static/app/bootstrap/initializeSdk.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {_browserPerformanceTimeOriginMode} from '@sentry/utils';
77
import {SENTRY_RELEASE_VERSION, SPA_DSN} from 'sentry/constants';
88
import {Config} from 'sentry/types';
99
import {addExtraMeasurements, LongTaskObserver} from 'sentry/utils/performanceForSentry';
10+
import {normalizeUrl} from 'sentry/utils/withDomainRequired';
1011

1112
const SPA_MODE_ALLOW_URLS = [
1213
'localhost',
@@ -99,6 +100,9 @@ export function initializeSdk(config: Config, {routes}: {routes?: Function} = {}
99100
partialDesc => !span.description?.includes(partialDesc)
100101
);
101102
});
103+
if (event.transaction) {
104+
event.transaction = normalizeUrl(event.transaction, {forceCustomerDomain: true});
105+
}
102106
return event;
103107
},
104108
/**

0 commit comments

Comments
 (0)