Skip to content

Commit cc9bf5d

Browse files
author
Luca Forstner
committed
.
1 parent fec77bc commit cc9bf5d

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

packages/tracing-internal/src/browser/browserTracingIntegration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
322322

323323
if (options.instrumentPageLoad && WINDOW.location) {
324324
const context: StartSpanOptions = {
325-
name: 'wtf2',
325+
name: WINDOW.location.pathname,
326326
// pageload should always start at timeOrigin (and needs to be in s, not ms)
327327
startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,
328328
origin: 'auto.pageload.browser',
@@ -352,7 +352,7 @@ export const browserTracingIntegration = ((_options: Partial<BrowserTracingOptio
352352
if (from !== to) {
353353
startingUrl = undefined;
354354
const context: StartSpanOptions = {
355-
name: 'wtf3',
355+
name: WINDOW.location.pathname,
356356
origin: 'auto.navigation.browser',
357357
attributes: {
358358
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',

packages/tracing-internal/src/browser/router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ export function instrumentRoutingWithDefaults<T extends Transaction>(
1818
return;
1919
}
2020

21-
let startingUrl: string | undefined = 'wtf4';
21+
let startingUrl: string | undefined = WINDOW.location.href;
2222

2323
let activeTransaction: T | undefined;
2424
if (startTransactionOnPageLoad) {
2525
activeTransaction = customStartTransaction({
26-
name: WINDOW.location.pathname, // wtf5
26+
name: WINDOW.location.pathname,
2727
// pageload should always start at timeOrigin (and needs to be in s, not ms)
2828
startTimestamp: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined,
2929
op: 'pageload',
@@ -58,7 +58,7 @@ export function instrumentRoutingWithDefaults<T extends Transaction>(
5858
activeTransaction.end();
5959
}
6060
activeTransaction = customStartTransaction({
61-
name: 'wtf6',
61+
name: WINDOW.location.pathname,
6262
op: 'navigation',
6363
origin: 'auto.navigation.browser',
6464
attributes: {

packages/tracing-internal/test/browser/browsertracing.test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,6 @@ describe('BrowserTracing', () => {
9999
customStartTransaction({ name: 'a/path', op: 'pageload' });
100100
};
101101

102-
it('_experiements calls onStartRouteTransaction on route instrumentation', () => {
103-
const onStartTranscation = jest.fn();
104-
createBrowserTracing(true, {
105-
_experiments: {
106-
onStartRouteTransaction: onStartTranscation,
107-
},
108-
});
109-
110-
expect(onStartTranscation).toHaveBeenCalledTimes(1);
111-
});
112-
113102
it('calls custom routing instrumenation', () => {
114103
createBrowserTracing(true, {
115104
routingInstrumentation: customInstrumentRouting,

0 commit comments

Comments
 (0)