Skip to content

feat(v8): Remove @sentry/tracing #10625

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 17 commits into from
Feb 23, 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
7 changes: 1 addition & 6 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,7 @@ targets:
id: '@sentry-internal/eslint-config-sdk'
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/

## 8. Deprecated packages we still release (but no packages depend on them anymore)
- name: npm
id: '@sentry/tracing'
includeNames: /^sentry-tracing-\d.*\.tgz$/

## 9. Experimental packages
## 8. Experimental packages
- name: npm
id: '@sentry/node-experimental'
includeNames: /^sentry-node-experimental-\d.*\.tgz$/
Expand Down
8 changes: 7 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ to access and mutate the current scope.

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

`@sentry/hub` has been removed. All exports from `@sentry.hub` should be available in `@sentry/core`.
`@sentry/hub` has been removed. All exports from `@sentry/tracing` should be available in `@sentry/core` or in
`@sentry/browser` and `@sentry/node`.

## Deletion of `@sentry/tracing` package

`@sentry/tracing` has been removed. All exports from `@sentry/tracing` should be available in `@sentry/core` or in
`@sentry/browser` and `@sentry/node`.

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

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ Besides the high-level SDKs, this repository contains shared packages, helpers a
development. If you're thinking about contributing to or creating a JavaScript-based SDK, have a look at the resources
below:

- [`@sentry/tracing`](https://github.com/getsentry/sentry-javascript/tree/master/packages/tracing): Provides
integrations and extensions for Performance Monitoring / Tracing.
- [`@sentry/replay`](https://github.com/getsentry/sentry-javascript/tree/master/packages/replay): Provides the
integration for Session Replay.
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all
Expand Down
1 change: 0 additions & 1 deletion dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@playwright/test": "^1.40.1",
"@sentry-internal/rrweb": "2.11.0",
"@sentry/browser": "7.100.0",
"@sentry/tracing": "7.100.0",
"axios": "1.6.7",
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable no-unused-vars */
import * as Sentry from '@sentry/browser';
// biome-ignore lint/nursery/noUnusedImports: Need to import tracing for side effect
import * as _ from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.addTracingExtensions();

Sentry.init({
dsn: 'https://[email protected]/1337',
tracesSampleRate: 1.0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable no-unused-vars */
import * as Sentry from '@sentry/browser';
// biome-ignore lint/nursery/noUnusedImports: Need to import tracing for side effect
import * as _ from '@sentry/tracing';

window.Sentry = Sentry;

Sentry.addTracingExtensions();

Sentry.init({
dsn: 'https://[email protected]/1337',
tracesSampleRate: 1.0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { SerializedEvent } from '@sentry/types';

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

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

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

expect(uiSpans?.length).toBe(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { SerializedEvent } from '@sentry/types';

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

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

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

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

expect(duration).toBeGreaterThanOrEqual(0.1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ window.Sentry = Sentry;
Sentry.init({
dsn: 'https://[email protected]/1337',
sampleRate: 1,
integrations: [new Sentry.browserTracingIntegration()],
integrations: [Sentry.browserTracingIntegration()],
});

// This should not fail
Expand Down
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({ idleTimeout: 9000, startTransactionOnPageLoad: false })],
integrations: [new Sentry.BrowserTracing({ idleTimeout: 9000, startTransactionOnPageLoad: false })],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -1,12 +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({
new Sentry.BrowserTracing({
idleTimeout: 1000,
_experiments: {
enableHTTPTimings: true,
Expand Down
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: [new Sentry.BrowserTracing()],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -1,12 +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({
new Sentry.BrowserTracing({
idleTimeout: 1000,
_experiments: {
enableInteractions: true,
Expand Down
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({ enableLongTask: false, idleTimeout: 9000 })],
integrations: [new Sentry.BrowserTracing({ enableLongTask: false, idleTimeout: 9000 })],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { SerializedEvent } from '@sentry/types';

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

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

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

expect(uiSpans?.length).toBe(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +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({
new Sentry.BrowserTracing({
idleTimeout: 9000,
}),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { SerializedEvent } from '@sentry/types';

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

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

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

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

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

window.Sentry = Sentry;
window._testBaseTimestamp = performance.timeOrigin / 1000;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing()],
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 1,
});
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._testBaseTimestamp = performance.timeOrigin / 1000;
Expand All @@ -8,7 +7,7 @@ setTimeout(() => {
window._testTimeoutTimestamp = (performance.timeOrigin + performance.now()) / 1000;
Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing()],
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 1,
});
}, 250);
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as Sentry from '@sentry/browser';
import { startSpanManual } from '@sentry/browser';
import { Integrations } from '@sentry/tracing';

window.Sentry = Sentry;

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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

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

window.Sentry = Sentry;

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

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Integrations.BrowserTracing({ tracingOrigins: [/.*/] })],
integrations: [new Sentry.BrowserTracing({ tracingOrigins: [/.*/] })],
environment: 'production',
tracesSampleRate: 1,
debug: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +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({
new Sentry.BrowserTracing({
idleTimeout: 9000,
}),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { SerializedEvent } from '@sentry/types';

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

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

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

// Spans `connect`, `cache` and `DNS` are not always inside `pageload` transaction.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Route } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';
import type { SerializedEvent } from '@sentry/types';

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

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

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

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