Skip to content

Commit 0e7ab1e

Browse files
author
Luca Forstner
authored
ref: Remove tracingOrigins options (#10614)
1 parent b5829e1 commit 0e7ab1e

File tree

30 files changed

+93
-438
lines changed

30 files changed

+93
-438
lines changed

MIGRATION.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Upgrading from 7.x to 8.x
22

3+
## Removal of the `tracingOrigins` option
4+
5+
After its deprecation in v7 the `tracingOrigins` option is now removed in favor of the `tracePropagationTargets` option.
6+
The `tracePropagationTargets` option should be set in the `Sentry.init()` options, or in your custom `Client`s option if
7+
you create them. The `tracePropagationTargets` option can no longer be set in the `browserTracingIntegration()` options.
8+
39
## Dropping Support for React 15
410

511
Sentry will no longer officially support React 15 in version 8. This means that React 15.x will be removed

dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customBrowserTracing/init.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ Sentry.onLoad(function () {
44
Sentry.init({
55
integrations: [
66
// Without this syntax, this will be re-written by the test framework
7-
new window['Sentry'].BrowserTracing({
8-
tracePropagationTargets: ['http://localhost:1234'],
9-
}),
7+
window['Sentry'].browserTracingIntegration(),
108
],
9+
tracePropagationTargets: ['http://localhost:1234'],
1110
});
1211
});

dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customBrowserTracing/test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,4 @@ sentryTest('should handle custom added BrowserTracing integration', async ({ get
2525
expect(eventData.contexts?.trace?.op).toBe('pageload');
2626
expect(eventData.spans?.length).toBeGreaterThan(0);
2727
expect(eventData.transaction_info?.source).toEqual('url');
28-
29-
const tracePropagationTargets = await page.evaluate(() => {
30-
const browserTracing = (window as any).Sentry.getClient().getIntegrationByName('BrowserTracing');
31-
return browserTracing.options.tracePropagationTargets;
32-
});
33-
34-
expect(tracePropagationTargets).toEqual(['http://localhost:1234']);
3528
});

dev-packages/browser-integration-tests/suites/replay/dsc/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54
window.Replay = new Sentry.Replay({
@@ -11,7 +10,8 @@ window.Replay = new Sentry.Replay({
1110

1211
Sentry.init({
1312
dsn: 'https://[email protected]/1337',
14-
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] }), window.Replay],
13+
integrations: [Sentry.browserTracingIntegration(), window.Replay],
14+
tracePropagationTargets: [/.*/],
1515
environment: 'production',
1616
tracesSampleRate: 1,
1717
// Needs manual start!

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTargets/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7-
integrations: [Sentry.browserTracingIntegration({ tracePropagationTargets: ['http://example.com'] })],
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: ['http://example.com'],
89
tracesSampleRate: 1,
910
});

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTargetsAndOrigins/init.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTargetsAndOrigins/subject.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTargetsAndOrigins/test.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTracingOrigins/init.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTracingOrigins/subject.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/tracePropagationTargets/customTracingOrigins/test.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54

65
Sentry.init({
76
dsn: 'https://[email protected]/1337',
8-
integrations: [new Integrations.BrowserTracing({ tracePropagationTargets: ['http://example.com'] })],
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: ['http://example.com'],
99
tracesSampleRate: 1,
1010
});

dev-packages/browser-integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/init.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/subject.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTargetsAndOrigins/test.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/init.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/subject.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev-packages/browser-integration-tests/suites/tracing/browsertracing/tracePropagationTargets/customTracingOrigins/test.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54

65
Sentry.init({
76
dsn: 'https://[email protected]/1337',
8-
integrations: [new Integrations.BrowserTracing()],
7+
integrations: [Sentry.browserTracingIntegration()],
98
tracesSampleRate: 1,
109
});

dev-packages/browser-integration-tests/suites/tracing/envelope-header/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54

65
Sentry.init({
76
dsn: 'https://[email protected]/1337',
8-
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] })],
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: [/.*/],
99
environment: 'production',
1010
tracesSampleRate: 1,
1111
debug: true,

dev-packages/browser-integration-tests/suites/tracing/request/fetch-with-no-active-span/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
// disable pageload transaction
8-
integrations: [Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'], startTransactionOnPageLoad: false })],
8+
integrations: [Sentry.browserTracingIntegration({ instrumentPageLoad: false })],
9+
tracePropagationTargets: ['http://example.com'],
910
tracesSampleRate: 1,
1011
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54

65
Sentry.init({
76
dsn: 'https://[email protected]/1337',
8-
integrations: [new Integrations.BrowserTracing({ tracingOrigins: ['http://example.com'] })],
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: ['http://example.com'],
99
tracesSampleRate: 1,
1010
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54

65
Sentry.init({
76
dsn: 'https://[email protected]/1337',
8-
integrations: [new Integrations.BrowserTracing({ tracingOrigins: ['http://example.com'] })],
7+
integrations: [Sentry.browserTracingIntegration()],
8+
tracePropagationTargets: ['http://example.com'],
99
tracesSampleRate: 1,
1010
});

dev-packages/browser-integration-tests/suites/tracing/request/xhr-with-no-active-span/init.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
// disable pageload transaction
8-
integrations: [Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'], startTransactionOnPageLoad: false })],
8+
integrations: [Sentry.browserTracingIntegration({ instrumentPageLoad: false })],
9+
tracePropagationTargets: ['http://example.com'],
910
tracesSampleRate: 1,
1011
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ module.exports = function (environment) {
2424
tracesSampleRate: 1,
2525
// Include fake dsn so that instrumentation is enabled when running from cli
2626
dsn: process.env.SENTRY_DSN || 'https://[email protected]/0',
27+
tracePropagationTargets: ['localhost', 'doesntexist.example'],
2728
browserTracingOptions: {
28-
tracingOrigins: ['localhost', 'doesntexist.example'],
2929
_experiments: {
3030
// This lead to some flaky tests, as that is sometimes logged
3131
enableLongTask: false,

packages/sveltekit/test/client/browserTracingIntegration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('browserTracingIntegration', () => {
5858
};
5959
});
6060

61-
const fakeClient = { getOptions: () => undefined, on: () => {} };
61+
const fakeClient = { getOptions: () => ({}), on: () => {} };
6262

6363
const mockedRoutingSpan = {
6464
end: () => {},

0 commit comments

Comments
 (0)