Skip to content

Commit 5138210

Browse files
committed
feat(sdk): Add a timeOrigin.mode tag
- This is so we can track how often we're changing timeOrigin to get a better calculation
1 parent 7050a1a commit 5138210

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sentry/static/sentry/app/bootstrap/initializeSdk.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {ExtraErrorData} from '@sentry/integrations';
33
import * as Sentry from '@sentry/react';
44
import SentryRRWeb from '@sentry/rrweb';
55
import {Integrations} from '@sentry/tracing';
6+
import {_browserPerformanceTimeOriginMode} from '@sentry/utils';
67

78
import {DISABLE_RR_WEB, SPA_DSN} from 'app/constants';
89
import {Config} from 'app/types';
@@ -79,6 +80,13 @@ export function initializeSdk(config: Config, {routes}: {routes?: Function} = {}
7980
tracesSampleRate,
8081
});
8182

83+
// Track timeOrigin Selection by the SDK to see if it improves transaction durations
84+
Sentry.addGlobalEventProcessor((event: Sentry.Event, _hint?: Sentry.EventHint) => {
85+
event.tags = event.tags || {};
86+
event.tags['timeOrigin.mode'] = _browserPerformanceTimeOriginMode;
87+
return event;
88+
});
89+
8290
if (userIdentity) {
8391
Sentry.setUser(userIdentity);
8492
}

0 commit comments

Comments
 (0)