Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all \u003cpre\u003e\u003ccode\u003e blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks"); } } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); } })(); (function(){ try { var __m = "github.com"; var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length \u003e 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
33d1cb0
feat: Refactor exposed `defaultIntegrations` to `getDefaultIntegratio…
mydea Jan 19, 2024
4c0481b
fix(next): Fix custom integrations (#10220)
mydea Jan 19, 2024
7688b60
ref(astro): Streamline how we add browser tracing (#10253)
mydea Jan 19, 2024
b916548
Merge pull request #10265 from getsentry/master
github-actions[bot] Jan 19, 2024
f3b2e7d
ref: Streamline SDK metadata handling (#10251)
mydea Jan 19, 2024
d3fecc1
feat(core): Deprecate `Span.parentSpanId` (#10244)
Lms24 Jan 19, 2024
1cceeae
feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attri…
Lms24 Jan 19, 2024
5f0b506
ref(wasm): Convert wasm integration to functional integration (#10230)
AbhiPrasad Jan 19, 2024
7e3207d
fix(wasm): Add `@sentry/core` as a dependency (#10283)
Lms24 Jan 22, 2024
a27deca
feat: Make `parameterize` function available through browser and node…
AleshaOleg Jan 23, 2024
6868256
fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
Methuselah96 Jan 23, 2024
a682534
feat(replay): Deprecate Replay, ReplayCanvas, Feedback classes (#10270)
mydea Jan 23, 2024
62b0c4d
feat(sveltekit): Update default integration handling & deprecate `add…
mydea Jan 23, 2024
a0b987a
feat(feedback): Configure feedback border radius (#10289)
c298lee Jan 23, 2024
675309d
feat(core): Expose `isInitialized()` to replace checking via `getClie…
mydea Jan 23, 2024
c017181
fix(tracing): Don't send negative ttfb (#10286)
AbhiPrasad Jan 23, 2024
d98bd74
meta(changelog): Update changelog for v7.95.0
mydea Jan 23, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -102,6 +102,7 @@ jobs:
- 'packages/replay/**'
- 'packages/replay-canvas/**'
- 'packages/feedback/**'
- 'packages/wasm/**'
browser_integration:
- *shared
- *browser
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,6 +4,47 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 7.95.0

### Important Changes

#### Deprecations

This release includes some deprecations in preparation for v8.

Most notably, it deprecates the `Replay` & `Feedback` classes in favor of a functional replacement:

```js
import * as Sentry from '@sentry/browser';

Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
```

- feat(core): Deprecate `Span.origin` in favor of `sentry.origin` attribute (#10260)
- feat(core): Deprecate `Span.parentSpanId` (#10244)
- feat(core): Expose `isInitialized()` to replace checking via `getClient` (#10296)
- feat(replay): Deprecate `Replay`, `ReplayCanvas`, `Feedback` classes (#10270)
- feat(wasm): Deprecate `Wasm` integration class (#10230)

### Other Changes

- feat: Make `parameterize` function available through browser and node API (#10085)
- feat(feedback): Configure feedback border radius (#10289)
- feat(sveltekit): Update default integration handling & deprecate `addOrUpdateIntegration` (#10263)
- fix(replay-canvas): Add missing dependency on @sentry/utils (#10279)
- fix(tracing): Don't send negative ttfb (#10286)

Comment thread
mydea marked this conversation as resolved.
Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.94.1

This release fixes a publishing issue.
Expand Down
25 changes: 18 additions & 7 deletions MIGRATION.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,12 @@ npx @sentry/migr8@latest
This will let you select which updates to run, and automatically update your code. Make sure to still review all code
changes!

## Deprecate using `getClient()` to check if the SDK was initialized

In v8, `getClient()` will stop returning `undefined` if `Sentry.init()` was not called. For cases where this may be used
to check if Sentry was actually initialized, using `getClient()` will thus not work anymore. Instead, you should use the
new `Sentry.isInitialized()` utility to check this.

## Deprecate `getCurrentHub()`

In v8, you will no longer have a Hub, only Scopes as a concept. This also means that `getCurrentHub()` will eventually
Expand All@@ -28,13 +34,17 @@ integrations from the `Integrations.XXX` hash, is deprecated in favor of using t

The following list shows how integrations should be migrated:

| Old | New |
| ------------------------ | ------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegrations()` |
| `new FunctionToString()` | `functionToStringIntegration()` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` |
| `new RequestData()` | `requestDataIntegration()` |
| Old | New | Packages |
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `new InboundFilters()` | `inboundFiltersIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new FunctionToString()` | `functionToStringIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new LinkedErrors()` | `linkedErrorsIntegration()` | `@sentry/core`, `@sentry/browser`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new ModuleMetadata()` | `moduleMetadataIntegration()` | `@sentry/core`, `@sentry/browser` |
| `new RequestData()` | `requestDataIntegration()` | `@sentry/core`, `@sentry/node`, `@sentry/deno`, `@sentry/bun`, `@sentry/vercel-edge` |
| `new Wasm() ` | `wasmIntegration()` | `@sentry/wasm` |
| `new Replay()` | `replayIntegration()` | `@sentry/browser` |
| `new ReplayCanvas()` | `replayCanvasIntegration()` | `@sentry/browser` |
| `new Feedback()` | `feedbackIntegration()` | `@sentry/browser` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand DownExpand Up@@ -193,6 +203,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
- `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
- `span.sampled`: Use `span.isRecording()` instead.
- `span.spanId`: Use `span.spanContext().spanId` instead.
- `span.parentSpanId`: Use `spanToJSON(span).parent_span_id` instead.
- `span.traceId`: Use `span.spanContext().traceId` instead.
- `span.name`: Use `spanToJSON(span).description` instead.
- `span.description`: Use `spanToJSON(span).description` instead.
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Sentry.captureMessage(Sentry.parameterize`This is a log statement with ${x} and ${y} params`);
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,12 +5,6 @@ import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

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

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
Expand Down
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should send a transaction in an envelope', async ({ getLocalTestPath
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('parent_span');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,14 +22,13 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.spans).toHaveLength(1);

const span_1 = transaction.spans?.[0];
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.description).toBe('child_span');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
expect(span_1?.parent_span_id).toEqual(transaction?.contexts?.trace?.span_id);
expect(span_1?.origin).toEqual('manual');
expect(span_1?.data?.['sentry.origin']).toEqual('manual');
});
Original file line numberDiff line numberDiff 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@@ -10,7 +10,7 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(transaction.transaction).toBe('test_transaction_1');
expect(transaction.spans).toBeDefined();
Expand All@@ -22,28 +22,26 @@ sentryTest('should report finished spans as children of the root transaction', a
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
const transaction = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

const rootSpanId = transaction?.contexts?.trace?.spanId;
const rootSpanId = transaction?.contexts?.trace?.span_id;

expect(transaction.spans).toHaveLength(3);

const span_1 = transaction.spans?.[0];

// eslint-disable-next-line deprecation/deprecation
expect(span_1?.op).toBe('span_1');
expect(span_1?.parentSpanId).toEqual(rootSpanId);
// eslint-disable-next-line deprecation/deprecation
expect(span_1?.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });
expect(span_1).toBeDefined();
expect(span_1!.op).toBe('span_1');
expect(span_1!.parent_span_id).toEqual(rootSpanId);
expect(span_1!.data).toMatchObject({ foo: 'bar', baz: [1, 2, 3] });

const span_3 = transaction.spans?.[1];
// eslint-disable-next-line deprecation/deprecation
expect(span_3?.op).toBe('span_3');
expect(span_3?.parentSpanId).toEqual(rootSpanId);
expect(span_3).toBeDefined();
expect(span_3!.op).toBe('span_3');
expect(span_3!.parent_span_id).toEqual(rootSpanId);

const span_5 = transaction.spans?.[2];
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.op).toBe('span_5');
// eslint-disable-next-line deprecation/deprecation
expect(span_5?.parentSpanId).toEqual(span_3?.spanId);
expect(span_5).toBeDefined();
expect(span_5!.op).toBe('span_5');
expect(span_5!.parent_span_id).toEqual(span_3!.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,6 +67,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -87,6 +88,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush();
}),
Expand DownExpand Up@@ -210,6 +212,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
Expand All@@ -230,6 +233,7 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
Expand DownExpand Up@@ -324,6 +328,7 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
Expand All@@ -342,6 +347,7 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,11 @@ import { sentryTest } from '../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../utils/helpers';
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '../../../utils/replayHelpers';

type TestWindow = Window & { Sentry: typeof Sentry; Replay: Sentry.Replay };
type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
};

sentryTest(
'should add replay_id to dsc of transactions when in session mode',
Expand Down
Original file line numberDiff line numberDiff 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@@ -16,16 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
// To trigger FID
await page.click('#fid-btn');

const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fid?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];

expect(fidSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fidSpan?.op).toBe('ui.action');
expect(fidSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff 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,18 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];

expect(fpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fpSpan?.op).toBe('paint');
expect(fpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});

sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
Expand All@@ -31,16 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.fcp?.value).toBeDefined();

// eslint-disable-next-line deprecation/deprecation
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];

expect(fcpSpan).toBeDefined();
// eslint-disable-next-line deprecation/deprecation
expect(fcpSpan?.op).toBe('paint');
expect(fcpSpan?.parentSpanId).toBe(eventData.contexts?.trace_span_id);
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
});
Original file line numberDiff line numberDiff line change
Expand Up@@ -69,6 +69,7 @@ test('Should trace outgoing fetch requests inside middleware and create breadcru
type: 'fetch',
url: 'http://localhost:3030/',
'sentry.op': 'http.client',
'sentry.origin': 'auto.http.wintercg_fetch',
},
description: 'GET http://localhost:3030/',
op: 'http.client',
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,6 +64,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -87,6 +88,7 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand DownExpand Up@@ -159,6 +161,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
span_id: expect.any(String),
Expand All@@ -182,6 +185,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
'otel.kind': 'SERVER',
'http.response.status_code': 200,
'sentry.op': 'http.server',
'sentry.origin': 'auto.http.otel.http',
},
op: 'http.server',
parent_span_id: outgoingHttpSpanId,
Expand Down
Loading