Skip to content

Commit

Permalink
feat(sdk): Add a timeOrigin.mode tag (#24901)
Browse files Browse the repository at this point in the history
- This is so we can track how often we're changing timeOrigin to get a
  better calculation
  • Loading branch information
wmak authored Apr 14, 2021
1 parent 7050a1a commit eac3d1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sentry/static/sentry/app/bootstrap/initializeSdk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {ExtraErrorData} from '@sentry/integrations';
import * as Sentry from '@sentry/react';
import SentryRRWeb from '@sentry/rrweb';
import {Integrations} from '@sentry/tracing';
import {_browserPerformanceTimeOriginMode} from '@sentry/utils';

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

// Track timeOrigin Selection by the SDK to see if it improves transaction durations
Sentry.addGlobalEventProcessor((event: Sentry.Event, _hint?: Sentry.EventHint) => {
event.tags = event.tags || {};
event.tags['timeOrigin.mode'] = _browserPerformanceTimeOriginMode;
return event;
});

if (userIdentity) {
Sentry.setUser(userIdentity);
}
Expand Down

0 comments on commit eac3d1e

Please sign in to comment.