Skip to content

ref: Remove tracingOrigins options #10614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Upgrading from 7.x to 8.x

## Removal of the `tracingOrigins` option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This likely needs to be rewritten since we're removing BrowserTracing completely anyway but for now it's okay. Was just worried because we didn't mention that we removed tracePropaagationTargets in the BrowserTracing options but realized it's not gonna matter 😅


After its deprecation in v7 the `tracingOrigins` option is now removed in favor of the `tracePropagationTargets` option.
The `tracePropagationTargets` option should be set in the `Sentry.init()` options, or in your custom `Client`s option if
you create them. The `tracePropagationTargets` option can no longer be set in the `browserTracingIntegration()` options.

## Dropping Support for React 15

Sentry will no longer officially support React 15 in version 8. This means that React 15.x will be removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ Sentry.onLoad(function () {
Sentry.init({
integrations: [
// Without this syntax, this will be re-written by the test framework
new window['Sentry'].BrowserTracing({
tracePropagationTargets: ['http://localhost:1234'],
}),
window['Sentry'].browserTracingIntegration(),
],
tracePropagationTargets: ['http://localhost:1234'],
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,4 @@ sentryTest('should handle custom added BrowserTracing integration', async ({ get
expect(eventData.contexts?.trace?.op).toBe('pageload');
expect(eventData.spans?.length).toBeGreaterThan(0);
expect(eventData.transaction_info?.source).toEqual('url');

const tracePropagationTargets = await page.evaluate(() => {
const browserTracing = (window as any).Sentry.getClient().getIntegrationByName('BrowserTracing');
return browserTracing.options.tracePropagationTargets;
});

expect(tracePropagationTargets).toEqual(['http://localhost:1234']);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
Expand All @@ -11,7 +10,8 @@ window.Replay = new Sentry.Replay({

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] }), window.Replay],
integrations: [Sentry.browserTracingIntegration(), window.Replay],
tracePropagationTargets: [/.*/],
environment: 'production',
tracesSampleRate: 1,
// Needs manual start!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [Sentry.browserTracingIntegration({ tracePropagationTargets: ['http://example.com'] })],
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing({ tracePropagationTargets: ['http://example.com'] })],
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing()],
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] })],
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: [/.*/],
environment: 'production',
tracesSampleRate: 1,
debug: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ window.Sentry = Sentry;
Sentry.init({
dsn: 'https://[email protected]/1337',
// disable pageload transaction
integrations: [Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'], startTransactionOnPageLoad: false })],
integrations: [Sentry.browserTracingIntegration({ instrumentPageLoad: false })],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing({ tracingOrigins: ['http://example.com'] })],
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as Sentry from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing({ tracingOrigins: ['http://example.com'] })],
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ window.Sentry = Sentry;
Sentry.init({
dsn: 'https://[email protected]/1337',
// disable pageload transaction
integrations: [Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'], startTransactionOnPageLoad: false })],
integrations: [Sentry.browserTracingIntegration({ instrumentPageLoad: false })],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});
2 changes: 1 addition & 1 deletion packages/ember/tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module.exports = function (environment) {
tracesSampleRate: 1,
// Include fake dsn so that instrumentation is enabled when running from cli
dsn: process.env.SENTRY_DSN || 'https://[email protected]/0',
tracePropagationTargets: ['localhost', 'doesntexist.example'],
browserTracingOptions: {
tracingOrigins: ['localhost', 'doesntexist.example'],
_experiments: {
// This lead to some flaky tests, as that is sometimes logged
enableLongTask: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('browserTracingIntegration', () => {
};
});

const fakeClient = { getOptions: () => undefined, on: () => {} };
const fakeClient = { getOptions: () => ({}), on: () => {} };

const mockedRoutingSpan = {
end: () => {},
Expand Down
Loading