Skip to content

Commit 0c4fdf6

Browse files
authored
ref(ember): Allow other integration options for default integration (#3534)
This will allow users to pass additional configuration (like 'tracingOrigins') to the default instrumented browser tracing integration.
1 parent bb323bc commit 0c4fdf6

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ function _instrumentInitialLoad(config: EmberSentryConfig) {
333333
export async function instrumentForPerformance(appInstance: ApplicationInstance) {
334334
const config = getSentryConfig();
335335
const sentryConfig = config.sentry;
336+
const browserTracingOptions = config.browserTracingOptions || {};
336337

337338
const tracing = await import('@sentry/tracing');
338339

@@ -349,6 +350,7 @@ export async function instrumentForPerformance(appInstance: ApplicationInstance)
349350
_instrumentEmberRouter(routerService, routerMain, config, customStartTransaction, startTransactionOnPageLoad);
350351
},
351352
idleTimeout,
353+
...browserTracingOptions,
352354
}),
353355
];
354356

packages/ember/addon/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type EmberSentryConfig = {
1212
enableComponentDefinitions: boolean;
1313
minimumRunloopQueueDuration: number;
1414
minimumComponentRenderDuration: number;
15+
browserTracingOptions: Object;
1516
};
1617

1718
export type OwnConfig = {

packages/ember/tests/dummy/config/environment.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ module.exports = function(environment) {
2828
tracesSampleRate: 1,
2929
dsn: process.env.SENTRY_DSN,
3030
},
31+
browserTracingOptions: {
32+
tracingOrigins: ['localhost', 'doesntexist.example'],
33+
},
3134
ignoreEmberOnErrorWarning: true,
3235
minimumRunloopQueueDuration: 5,
3336
minimumComponentRenderDuration: 2,

0 commit comments

Comments
 (0)