Skip to content

Commit 39a52a7

Browse files
committed
fixes
1 parent 5272c77 commit 39a52a7

3 files changed

Lines changed: 13 additions & 19 deletions

File tree

packages/ember/addon/instance-initializers/sentry-performance.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
/* eslint-disable max-lines */
22
import 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

215
export function initialize(appInstance: ApplicationInstance): void {
226
// Disable in fastboot - we only want to run Sentry client-side

packages/ember/addon/utils/browserTracingIntegration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
};

packages/ember/addon/utils/performance.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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>();

0 commit comments

Comments
 (0)