File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/* eslint-disable max-lines */
22import type ApplicationInstance from '@ember/application/instance' ;
3- import { getOwnConfig } from '@embroider/macros' ;
4- import { GLOBAL_OBJ } from '@sentry/core' ;
5- import type { EmberSentryConfig , GlobalConfig , OwnConfig } from '../types' ;
6- import { instrumentForPerformance } from '../utils/performance' ;
7-
8- function getSentryConfig ( ) : EmberSentryConfig {
9- const _global = GLOBAL_OBJ as typeof GLOBAL_OBJ & GlobalConfig ;
10- _global . __sentryEmberConfig = _global . __sentryEmberConfig ?? { } ;
11- const environmentConfig = getOwnConfig < OwnConfig > ( ) . sentryConfig ;
12- if ( ! environmentConfig . sentry ) {
13- environmentConfig . sentry = {
14- browserTracingOptions : { } ,
15- } ;
16- }
17- Object . assign ( environmentConfig . sentry , _global . __sentryEmberConfig ) ;
18- return environmentConfig ;
19- }
3+ import { instrumentForPerformance , getSentryConfig } from '../utils/performance' ;
204
215export function initialize ( appInstance : ApplicationInstance ) : void {
226 // Disable in fastboot - we only want to run Sentry client-side
Original file line number Diff line number Diff line change @@ -42,9 +42,9 @@ export function browserTracingIntegration(options: EmberBrowserTracingIntegratio
4242
4343 const globalsPerformanceConfig = {
4444 disableRunloopPerformance : options . disableRunloopPerformance ?? false ,
45- minimumRunloopQueueDuration : options . minimumRunloopQueueDuration ?? 0 ,
45+ minimumRunloopQueueDuration : options . minimumRunloopQueueDuration ,
4646 disableInstrumentComponents : options . disableInstrumentComponents ?? false ,
47- minimumComponentRenderDuration : options . minimumComponentRenderDuration ?? 0 ,
47+ minimumComponentRenderDuration : options . minimumComponentRenderDuration ,
4848 enableComponentDefinitions : options . enableComponentDefinitions ?? false ,
4949 disableInitialLoadInstrumentation : options . disableInitialLoadInstrumentation ?? false ,
5050 } ;
Original file line number Diff line number Diff line change @@ -55,10 +55,20 @@ export function instrumentForPerformance(appInstance: ApplicationInstance): void
5555
5656 const idleTimeout = config . transitionTimeout || 5000 ;
5757
58+ const emberSpecificConfig = {
59+ minimumRunloopQueueDuration : config . minimumRunloopQueueDuration ,
60+ minimumComponentRenderDuration : config . minimumComponentRenderDuration ,
61+ enableComponentDefinitions : config . enableComponentDefinitions ,
62+ disableInitialLoadInstrumentation : config . disableInitialLoadInstrumentation ,
63+ disableRunloopPerformance : config . disableRunloopPerformance ,
64+ disableInstrumentComponents : config . disableInstrumentComponents ,
65+ } ;
66+
5867 const browserTracing = browserTracingIntegration ( {
5968 appInstance,
6069 idleTimeout,
6170 ...browserTracingOptions ,
71+ ...emberSpecificConfig ,
6272 } ) ;
6373
6474 const client = getClient < BrowserClient > ( ) ;
You can’t perform that action at this time.
0 commit comments