Skip to content

Commit 437d20a

Browse files
authored
feat(v8): Remove @sentry/tracing (#10625)
Aside from deleting the tracing package and all of it's references, it also moves some relevant tests into core.
1 parent 36806f3 commit 437d20a

File tree

88 files changed

+278
-2517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+278
-2517
lines changed

.craft.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,7 @@ targets:
131131
id: '@sentry-internal/eslint-config-sdk'
132132
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/
133133

134-
## 8. Deprecated packages we still release (but no packages depend on them anymore)
135-
- name: npm
136-
id: '@sentry/tracing'
137-
includeNames: /^sentry-tracing-\d.*\.tgz$/
138-
139-
## 9. Experimental packages
134+
## 8. Experimental packages
140135
- name: npm
141136
id: '@sentry/node-experimental'
142137
includeNames: /^sentry-node-experimental-\d.*\.tgz$/

MIGRATION.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,13 @@ to access and mutate the current scope.
8888

8989
## Deletion of `@sentry/hub` package (#10530)
9090

91-
`@sentry/hub` has been removed. All exports from `@sentry.hub` should be available in `@sentry/core`.
91+
`@sentry/hub` has been removed. All exports from `@sentry/tracing` should be available in `@sentry/core` or in
92+
`@sentry/browser` and `@sentry/node`.
93+
94+
## Deletion of `@sentry/tracing` package
95+
96+
`@sentry/tracing` has been removed. All exports from `@sentry/tracing` should be available in `@sentry/core` or in
97+
`@sentry/browser` and `@sentry/node`.
9298

9399
## Removal of `makeXHRTransport` transport (#10703)
94100

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ Besides the high-level SDKs, this repository contains shared packages, helpers a
9595
development. If you're thinking about contributing to or creating a JavaScript-based SDK, have a look at the resources
9696
below:
9797

98-
- [`@sentry/tracing`](https://github.com/getsentry/sentry-javascript/tree/master/packages/tracing): Provides
99-
integrations and extensions for Performance Monitoring / Tracing.
10098
- [`@sentry/replay`](https://github.com/getsentry/sentry-javascript/tree/master/packages/replay): Provides the
10199
integration for Session Replay.
102100
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all

dev-packages/browser-integration-tests/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@playwright/test": "^1.40.1",
4949
"@sentry-internal/rrweb": "2.11.0",
5050
"@sentry/browser": "7.100.0",
51-
"@sentry/tracing": "7.100.0",
5251
"axios": "1.6.7",
5352
"babel-loader": "^8.2.2",
5453
"html-webpack-plugin": "^5.5.0",

dev-packages/browser-integration-tests/suites/public-api/startSpan/init.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/* eslint-disable no-unused-vars */
21
import * as Sentry from '@sentry/browser';
3-
// biome-ignore lint/nursery/noUnusedImports: Need to import tracing for side effect
4-
import * as _ from '@sentry/tracing';
52

63
window.Sentry = Sentry;
74

5+
Sentry.addTracingExtensions();
6+
87
Sentry.init({
98
dsn: 'https://[email protected]/1337',
109
tracesSampleRate: 1.0,

dev-packages/browser-integration-tests/suites/public-api/startTransaction/init.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/* eslint-disable no-unused-vars */
21
import * as Sentry from '@sentry/browser';
3-
// biome-ignore lint/nursery/noUnusedImports: Need to import tracing for side effect
4-
import * as _ from '@sentry/tracing';
52

63
window.Sentry = Sentry;
74

5+
Sentry.addTracingExtensions();
6+
87
Sentry.init({
98
dsn: 'https://[email protected]/1337',
109
tracesSampleRate: 1.0,

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-disabled/test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from '@playwright/test';
22
import { expect } from '@playwright/test';
3-
import type { Event } from '@sentry/types';
3+
import type { SerializedEvent } from '@sentry/types';
44

55
import { sentryTest } from '../../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -15,8 +15,7 @@ sentryTest('should not capture long task when flag is disabled.', async ({ brows
1515

1616
const url = await getLocalTestPath({ testDir: __dirname });
1717

18-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
19-
// eslint-disable-next-line deprecation/deprecation
18+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2019
const uiSpans = eventData.spans?.filter(({ op }) => op?.startsWith('ui'));
2120

2221
expect(uiSpans?.length).toBe(0);

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/long-tasks-enabled/test.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from '@playwright/test';
22
import { expect } from '@playwright/test';
3-
import type { Event } from '@sentry/types';
3+
import type { SerializedEvent } from '@sentry/types';
44

55
import { sentryTest } from '../../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -15,8 +15,7 @@ sentryTest('should capture long task.', async ({ browserName, getLocalTestPath,
1515

1616
const url = await getLocalTestPath({ testDir: __dirname });
1717

18-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
19-
// eslint-disable-next-line deprecation/deprecation
18+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2019
const uiSpans = eventData.spans?.filter(({ op }) => op?.startsWith('ui'));
2120

2221
expect(uiSpans?.length).toBeGreaterThan(0);
@@ -29,8 +28,8 @@ sentryTest('should capture long task.', async ({ browserName, getLocalTestPath,
2928
parent_span_id: eventData.contexts?.trace?.span_id,
3029
}),
3130
);
32-
const start = (firstUISpan as Event)['start_timestamp'] ?? 0;
33-
const end = (firstUISpan as Event)['timestamp'] ?? 0;
31+
const start = firstUISpan.start_timestamp ?? 0;
32+
const end = firstUISpan.timestamp ?? 0;
3433
const duration = end - start;
3534

3635
expect(duration).toBeGreaterThanOrEqual(0.1);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
sampleRate: 1,
8-
integrations: [new Sentry.browserTracingIntegration()],
8+
integrations: [Sentry.browserTracingIntegration()],
99
});
1010

1111
// This should not fail
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({ idleTimeout: 9000, startTransactionOnPageLoad: false })],
7+
integrations: [new Sentry.BrowserTracing({ idleTimeout: 9000, startTransactionOnPageLoad: false })],
98
tracesSampleRate: 1,
109
});

dev-packages/browser-integration-tests/suites/tracing/browsertracing/http-timings/init.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +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',
87
integrations: [
9-
new Integrations.BrowserTracing({
8+
new Sentry.BrowserTracing({
109
idleTimeout: 1000,
1110
_experiments: {
1211
enableHTTPTimings: true,
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: [new Sentry.BrowserTracing()],
98
tracesSampleRate: 1,
109
});

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +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',
87
integrations: [
9-
new Integrations.BrowserTracing({
8+
new Sentry.BrowserTracing({
109
idleTimeout: 1000,
1110
_experiments: {
1211
enableInteractions: true,
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({ enableLongTask: false, idleTimeout: 9000 })],
7+
integrations: [new Sentry.BrowserTracing({ enableLongTask: false, idleTimeout: 9000 })],
98
tracesSampleRate: 1,
109
});

dev-packages/browser-integration-tests/suites/tracing/browsertracing/long-tasks-disabled/test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from '@playwright/test';
22
import { expect } from '@playwright/test';
3-
import type { Event } from '@sentry/types';
3+
import type { SerializedEvent } from '@sentry/types';
44

55
import { sentryTest } from '../../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -15,8 +15,7 @@ sentryTest('should not capture long task when flag is disabled.', async ({ brows
1515

1616
const url = await getLocalTestPath({ testDir: __dirname });
1717

18-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
19-
// eslint-disable-next-line deprecation/deprecation
18+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2019
const uiSpans = eventData.spans?.filter(({ op }) => op?.startsWith('ui'));
2120

2221
expect(uiSpans?.length).toBe(0);

dev-packages/browser-integration-tests/suites/tracing/browsertracing/long-tasks-enabled/init.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +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',
87
integrations: [
9-
new Integrations.BrowserTracing({
8+
new Sentry.BrowserTracing({
109
idleTimeout: 9000,
1110
}),
1211
],

dev-packages/browser-integration-tests/suites/tracing/browsertracing/long-tasks-enabled/test.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from '@playwright/test';
22
import { expect } from '@playwright/test';
3-
import type { Event } from '@sentry/types';
3+
import type { SerializedEvent } from '@sentry/types';
44

55
import { sentryTest } from '../../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -15,8 +15,7 @@ sentryTest('should capture long task.', async ({ browserName, getLocalTestPath,
1515

1616
const url = await getLocalTestPath({ testDir: __dirname });
1717

18-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
19-
// eslint-disable-next-line deprecation/deprecation
18+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2019
const uiSpans = eventData.spans?.filter(({ op }) => op?.startsWith('ui'));
2120

2221
expect(uiSpans?.length).toBeGreaterThan(0);
@@ -29,8 +28,8 @@ sentryTest('should capture long task.', async ({ browserName, getLocalTestPath,
2928
parent_span_id: eventData.contexts?.trace?.span_id,
3029
}),
3130
);
32-
const start = (firstUISpan as Event)['start_timestamp'] ?? 0;
33-
const end = (firstUISpan as Event)['timestamp'] ?? 0;
31+
const start = firstUISpan.start_timestamp ?? 0;
32+
const end = firstUISpan.timestamp ?? 0;
3433
const duration = end - start;
3534

3635
expect(duration).toBeGreaterThanOrEqual(0.1);
Original file line numberDiff line numberDiff line change
@@ -1,11 +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()],
7+
integrations: [new Sentry.BrowserTracing()],
98
tracesSampleRate: 1,
109
environment: 'staging',
1110
});
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Integrations } from '@sentry/tracing';
32

43
window.Sentry = Sentry;
54
window._testBaseTimestamp = performance.timeOrigin / 1000;
65

76
Sentry.init({
87
dsn: 'https://[email protected]/1337',
9-
integrations: [new Integrations.BrowserTracing()],
8+
integrations: [new Sentry.BrowserTracing()],
109
tracesSampleRate: 1,
1110
});
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._testBaseTimestamp = performance.timeOrigin / 1000;
@@ -8,7 +7,7 @@ setTimeout(() => {
87
window._testTimeoutTimestamp = (performance.timeOrigin + performance.now()) / 1000;
98
Sentry.init({
109
dsn: 'https://[email protected]/1337',
11-
integrations: [new Integrations.BrowserTracing()],
10+
integrations: [new Sentry.BrowserTracing()],
1211
tracesSampleRate: 1,
1312
});
1413
}, 250);

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import * as Sentry from '@sentry/browser';
22
import { startSpanManual } from '@sentry/browser';
3-
import { Integrations } from '@sentry/tracing';
43

54
window.Sentry = Sentry;
65

76
Sentry.init({
87
dsn: 'https://[email protected]/1337',
9-
integrations: [new Integrations.BrowserTracing()],
8+
integrations: [new Sentry.BrowserTracing()],
109
tracesSampleRate: 1,
1110
});
1211

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [new Sentry.BrowserTracing({ tracePropagationTargets: [], tracingOrigins: ['http://example.com'] })],
8+
tracesSampleRate: 1,
9+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [new Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'] })],
8+
tracesSampleRate: 1,
9+
});

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import * as Sentry from '@sentry/browser';
22
import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/browser';
3-
import { Integrations } from '@sentry/tracing';
43

54
window.Sentry = Sentry;
65

76
Sentry.init({
87
dsn: 'https://[email protected]/1337',
9-
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] })],
8+
integrations: [new Sentry.BrowserTracing({ tracingOrigins: [/.*/] })],
109
environment: 'production',
1110
tracesSampleRate: 1,
1211
debug: true,

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +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',
87
integrations: [
9-
new Integrations.BrowserTracing({
8+
new Sentry.BrowserTracing({
109
idleTimeout: 9000,
1110
}),
1211
],

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
2+
import type { SerializedEvent } from '@sentry/types';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -11,8 +11,7 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
1111

1212
const url = await getLocalTestPath({ testDir: __dirname });
1313

14-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
15-
// eslint-disable-next-line deprecation/deprecation
14+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
1615
const browserSpans = eventData.spans?.filter(({ op }) => op === 'browser');
1716

1817
// Spans `connect`, `cache` and `DNS` are not always inside `pageload` transaction.

dev-packages/browser-integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from '@playwright/test';
22
import { expect } from '@playwright/test';
3-
import type { Event } from '@sentry/types';
3+
import type { SerializedEvent } from '@sentry/types';
44

55
import { sentryTest } from '../../../../utils/fixtures';
66
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -17,8 +17,7 @@ sentryTest('should add resource spans to pageload transaction', async ({ getLoca
1717

1818
const url = await getLocalTestPath({ testDir: __dirname });
1919

20-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
21-
// eslint-disable-next-line deprecation/deprecation
20+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
2221
const resourceSpans = eventData.spans?.filter(({ op }) => op?.startsWith('resource'));
2322

2423
// Webkit 16.0 (which is linked to Playwright 1.27.1) consistently creates 2 consectutive spans for `css`,

0 commit comments

Comments
 (0)