Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

meta(changelog): Update changelog for 8.41.0 #14502

Merged
merged 35 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7a10218
feat(core): Deprecate `urlEncode` (#14406)
lforst Nov 22, 2024
fc79e97
feat(core): Deprecate `arrayify` (#14405)
lforst Nov 22, 2024
1b0382e
feat(core): Deprecate `validSeverityLevels` (#14407)
lforst Nov 22, 2024
99817ea
Merge pull request #14428 from getsentry/master
github-actions[bot] Nov 22, 2024
9c6028e
ci: Fix canary test workflow (#14429)
mydea Nov 22, 2024
498d6d1
feat(utils): Deprecate `@sentry/utils` (#14431)
lforst Nov 22, 2024
d49f1cb
feat(utils/core): Deprecate `addRequestDataToEvent` and `extractReque…
lforst Nov 22, 2024
ce1df3e
test(nextjs): Adapt slow test (#14403)
chargome Nov 22, 2024
b0c3f5f
feat(core): Log warnings when returning `null` in `beforeSendSpan` (#…
chargome Nov 22, 2024
6fbab43
feat(nuxt): Only delete public source maps (#14438)
s1gr1d Nov 22, 2024
05479b8
feat(nuxt): Add filter for not found source maps (devtools) (#14437)
s1gr1d Nov 22, 2024
d8d9324
test: Add tests to demonstrate root trace ID behavior (#14426)
mydea Nov 25, 2024
807883e
feat(vue): Deprecate configuring Vue tracing options anywhere else ot…
lforst Nov 25, 2024
8f6dd04
fix(nextjs): Don't report `NEXT_REDIRECT` from browser (#14440)
NEKOYASAN Nov 25, 2024
56e73ce
chore: Add external contributor to CHANGELOG.md (#14452)
HazAT Nov 25, 2024
8d1dbb1
feat(utils): Deprecate `memoBuilder`, `BAGGAGE_HEADER_NAME`, and `mak…
lforst Nov 25, 2024
1fd377f
test(nextjs): Add test for redirects from server actions (#14451)
chargome Nov 25, 2024
1b7815a
test(nextjs): Fix turbopack test (#14455)
chargome Nov 25, 2024
3742bd3
feat(core): Deprecate `flatten` (#14454)
andreiborza Nov 25, 2024
d9909e0
chore(docs): Add `flatten` deprecation to v9 migration guide (#14460)
andreiborza Nov 25, 2024
1a31ec4
ref(browser): Avoid optional chaining (#14457)
mydea Nov 25, 2024
b271bc8
feat(core): Update & deprecate `undefined` option handling (#14450)
mydea Nov 25, 2024
fc1d986
ref: Remove & streamline some debug logs (#14456)
mydea Nov 26, 2024
91a4985
feat(core/utils): Deprecate `getNumberOfUrlSegments` (#14458)
lforst Nov 26, 2024
cf368b1
meta: Backfill v9 migration guide items (#14459)
lforst Nov 26, 2024
b59ce07
feat: Streamline `sentry-trace`, `baggage` and DSC handling (#14364)
mydea Nov 26, 2024
1d32374
chore(nuxt): Remove nft override to ensure we are testing with latest…
andreiborza Nov 26, 2024
973ef9c
chore: Add GHSA entry for nuxt e2e test (#14490)
chargome Nov 26, 2024
23e3783
meta(nuxt): Require minimum Nuxt v3.7.0 (#14473)
s1gr1d Nov 26, 2024
09a31d1
feat(node): Add `openTelemetryInstrumentations` option (#14484)
lforst Nov 27, 2024
de65590
feat(core): Further optimize debug ID parsing (#14365)
timfish Nov 27, 2024
1e0cb04
ref(core): Do not check baggage validity (#14479)
mydea Nov 27, 2024
3e7969f
feat: Deprecate `registerEsmLoaderHooks.include` and `registerEsmLoad…
lforst Nov 27, 2024
a4138e9
perf(opentelemetry): Bucket spans for cleanup (#14154)
fmorett Nov 27, 2024
f7289c4
meta(changelog): Update changelog for 8.41.0
lforst Nov 27, 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
4 changes: 3 additions & 1 deletion .github/dependency-review-config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
fail-on-severity: 'high'
allow-ghsas:
# dependency review does not allow specific file exclusions
# we use an older version of NextJS in our tests and thus need to
# we use an older version of NextJS in our tests and thus need to
# exclude this
# once our minimum supported version is over 14.1.1 this can be removed
- GHSA-fr5h-rqp8-mj6g
# we need this for an E2E test for the minimum required version of Nuxt 3.7.0
- GHSA-v784-fjjh-f8r4
4 changes: 2 additions & 2 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ env:

CACHED_BUILD_PATHS: |
${{ github.workspace }}/packages/*/*.tgz
${{ github.workspace }}/dev-packages/test-utils/build
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
${{ github.workspace }}/packages/utils/build
${{ github.workspace }}/dev-packages/*/build
${{ github.workspace }}/packages/*/build

permissions:
contents: read
Expand Down
12 changes: 6 additions & 6 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/index.js',
import: createImport('init', 'browserTracingIntegration'),
gzip: true,
limit: '36.5 KB',
limit: '37.5 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay)',
Expand Down Expand Up @@ -124,22 +124,22 @@ module.exports = [
import: createImport('init', 'ErrorBoundary', 'reactRouterV6BrowserTracingIntegration'),
ignore: ['react/jsx-runtime'],
gzip: true,
limit: '39.5 KB',
limit: '40.5 KB',
},
// Vue SDK (ESM)
{
name: '@sentry/vue',
path: 'packages/vue/build/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '28 KB',
limit: '29 KB',
},
{
name: '@sentry/vue (incl. Tracing)',
path: 'packages/vue/build/esm/index.js',
import: createImport('init', 'browserTracingIntegration'),
gzip: true,
limit: '38.5 KB',
limit: '39.5 KB',
},
// Svelte SDK (ESM)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ module.exports = [
path: createCDNPath('bundle.tracing.min.js'),
gzip: false,
brotli: false,
limit: '113 KB',
limit: '120 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay) - uncompressed',
Expand Down Expand Up @@ -219,7 +219,7 @@ module.exports = [
import: createImport('init'),
ignore: ['$app/stores'],
gzip: true,
limit: '37 KB',
limit: '38 KB',
},
// Node SDK (ESM)
{
Expand Down
94 changes: 94 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,100 @@

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

## 8.41.0

### Important Changes

- **meta(nuxt): Require minimum Nuxt v3.7.0 ([#14473](https://github.com/getsentry/sentry-javascript/pull/14473))**

We formalized that the Nuxt SDK is at minimum compatible with Nuxt version 3.7.0 and above.
Additionally, the SDK requires the implicit `nitropack` dependency to satisfy version `^2.6.1` and `ofetch` to satisfy `^1.3.3`.
Copy link
Member

@s1gr1d s1gr1d Nov 27, 2024

Choose a reason for hiding this comment

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

The minimum required versions are the following:
image
It's added at the bottom of the PR description: #14473

It is recommended to check your lock-files and manually upgrade these dependencies if they don't match the version ranges.

### Deprecations

We are deprecating a few APIs which will be removed in the next major.

The following deprecations will _potentially_ affect you:

- **feat(core): Update & deprecate `undefined` option handling ([#14450](https://github.com/getsentry/sentry-javascript/pull/14450))**

In the next major version we will change how passing `undefined` to `tracesSampleRate` / `tracesSampler` / `enableTracing` will behave.

Currently, doing the following:

```ts
Sentry.init({
tracesSampleRate: undefined,
});
```

Will result in tracing being _enabled_ (although no spans will be generated) because the `tracesSampleRate` key is present in the options object.
In the next major version, this behavior will be changed so that passing `undefined` (or rather having a `tracesSampleRate` key) will result in tracing being disabled, the same as not passing the option at all.
If you are currently relying on `undefined` being passed, and and thus have tracing enabled, it is recommended to update your config to set e.g. `tracesSampleRate: 0` instead, which will also enable tracing in v9.

The same applies to `tracesSampler` and `enableTracing`.

- **feat(core): Log warnings when returning `null` in `beforeSendSpan` ([#14433](https://github.com/getsentry/sentry-javascript/pull/14433))**

Currently, the `beforeSendSpan` option in `Sentry.init()` allows you to drop individual spans from a trace by returning `null` from the hook.
Since this API lends itself to creating "gaps" inside traces, we decided to change how this API will work in the next major version.

With the next major version the `beforeSendSpan` API can only be used to mutate spans, but no longer to drop them.
With this release the SDK will warn you if you are using this API to drop spans.
Instead, it is recommended to configure instrumentation (i.e. integrations) directly to control what spans are created.

Additionally, with the next major version, root spans will also be passed to `beforeSendSpan`.

- **feat(utils): Deprecate `@sentry/utils` ([#14431](https://github.com/getsentry/sentry-javascript/pull/14431))**

With the next major version the `@sentry/utils` package will be merged into the `@sentry/core` package.
It is therefore no longer recommended to use the `@sentry/utils` package.

- **feat(vue): Deprecate configuring Vue tracing options anywhere else other than through the `vueIntegration`'s `tracingOptions` option ([#14385](https://github.com/getsentry/sentry-javascript/pull/14385))**

Currently it is possible to configure tracing options in various places in the Sentry Vue SDK:

- In `Sentry.init()`
- Inside `tracingOptions` in `Sentry.init()`
- In the `vueIntegration()` options
- Inside `tracingOptions` in the `vueIntegration()` options

Because this is a bit messy and confusing to document, the only recommended way to configure tracing options going forward is through the `tracingOptions` in the `vueIntegration()`.
The other means of configuration will be removed in the next major version of the SDK.

- **feat: Deprecate `registerEsmLoaderHooks.include` and `registerEsmLoaderHooks.exclude` ([#14486](https://github.com/getsentry/sentry-javascript/pull/14486))**

Currently it is possible to define `registerEsmLoaderHooks.include` and `registerEsmLoaderHooks.exclude` options in `Sentry.init()` to only apply ESM loader hooks to a subset of modules.
This API served as an escape hatch in case certain modules are incompatible with ESM loader hooks.

Since this API was introduced, a way was found to only wrap modules that there exists instrumentation for (meaning a vetted list).
To only wrap modules that have instrumentation, it is recommended to instead set `registerEsmLoaderHooks.onlyIncludeInstrumentedModules` to `true`.

Note that `onlyIncludeInstrumentedModules: true` will become the default behavior in the next major version and the `registerEsmLoaderHooks` will no longer accept fine-grained options.

The following deprecations will _most likely_ not affect you unless you are building an SDK yourself:

- feat(core): Deprecate `arrayify` ([#14405](https://github.com/getsentry/sentry-javascript/pull/14405))
- feat(core): Deprecate `flatten` ([#14454](https://github.com/getsentry/sentry-javascript/pull/14454))
- feat(core): Deprecate `urlEncode` ([#14406](https://github.com/getsentry/sentry-javascript/pull/14406))
- feat(core): Deprecate `validSeverityLevels` ([#14407](https://github.com/getsentry/sentry-javascript/pull/14407))
- feat(core/utils): Deprecate `getNumberOfUrlSegments` ([#14458](https://github.com/getsentry/sentry-javascript/pull/14458))
- feat(utils): Deprecate `memoBuilder`, `BAGGAGE_HEADER_NAME`, and `makeFifoCache` ([#14434](https://github.com/getsentry/sentry-javascript/pull/14434))
- feat(utils/core): Deprecate `addRequestDataToEvent` and `extractRequestData` ([#14430](https://github.com/getsentry/sentry-javascript/pull/14430))

### Other Changes

- feat: Streamline `sentry-trace`, `baggage` and DSC handling ([#14364](https://github.com/getsentry/sentry-javascript/pull/14364))
- feat(core): Further optimize debug ID parsing ([#14365](https://github.com/getsentry/sentry-javascript/pull/14365))
- feat(node): Add `openTelemetryInstrumentations` option ([#14484](https://github.com/getsentry/sentry-javascript/pull/14484))
- feat(nuxt): Add filter for not found source maps (devtools) ([#14437](https://github.com/getsentry/sentry-javascript/pull/14437))
- feat(nuxt): Only delete public source maps ([#14438](https://github.com/getsentry/sentry-javascript/pull/14438))
- fix(nextjs): Don't report `NEXT_REDIRECT` from browser ([#14440](https://github.com/getsentry/sentry-javascript/pull/14440))
- perf(opentelemetry): Bucket spans for cleanup ([#14154](https://github.com/getsentry/sentry-javascript/pull/14154))

Work in this release was contributed by @NEKOYASAN and @fmorett. Thank you for your contributions!

## 8.40.0

### Important Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sentryTest('should not add source context lines to errors from script files', as
const url = await getLocalTestUrl({ testDir: __dirname });

const eventReqPromise = waitForErrorRequestOnUrl(page, url);
await page.waitForFunction('window.Sentry');

const clickPromise = page.locator('#script-error-btn').click();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Sentry.withScope(() => {
Sentry.startSpan({ name: 'test_span_1' }, () => undefined);
Sentry.startSpan({ name: 'test_span_2' }, () => undefined);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { expect } from '@playwright/test';

import type { TransactionEvent } from '@sentry/types';
import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';

sentryTest(
'should send manually started parallel root spans outside of root context',
async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

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

const transaction1ReqPromise = waitForTransactionRequest(page, event => event.transaction === 'test_span_1');
const transaction2ReqPromise = waitForTransactionRequest(page, event => event.transaction === 'test_span_2');

await page.goto(url);

const [transaction1Req, transaction2Req] = await Promise.all([transaction1ReqPromise, transaction2ReqPromise]);

const transaction1 = envelopeRequestParser<TransactionEvent>(transaction1Req);
const transaction2 = envelopeRequestParser<TransactionEvent>(transaction2Req);

expect(transaction1).toBeDefined();
expect(transaction2).toBeDefined();

const trace1Id = transaction1.contexts?.trace?.trace_id;
const trace2Id = transaction2.contexts?.trace?.trace_id;

expect(trace1Id).toBeDefined();
expect(trace2Id).toBeDefined();

// We use the same traceID from the root propagation context here
expect(trace1Id).toBe(trace2Id);

expect(transaction1.contexts?.trace?.parent_span_id).toBeUndefined();
expect(transaction2.contexts?.trace?.parent_span_id).toBeUndefined();
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Sentry.getCurrentScope().setPropagationContext({
parentSpanId: '1234567890123456',
spanId: '123456789012345x',
traceId: '12345678901234567890123456789012',
});

Sentry.startSpan({ name: 'test_span_1' }, () => undefined);
Sentry.startSpan({ name: 'test_span_2' }, () => undefined);
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { expect } from '@playwright/test';

import type { TransactionEvent } from '@sentry/types';
import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';

sentryTest(
'should send manually started parallel root spans in root context with parentSpanId',
async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

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

const transaction1ReqPromise = waitForTransactionRequest(page, event => event.transaction === 'test_span_1');
const transaction2ReqPromise = waitForTransactionRequest(page, event => event.transaction === 'test_span_2');

await page.goto(url);

const [transaction1Req, transaction2Req] = await Promise.all([transaction1ReqPromise, transaction2ReqPromise]);

const transaction1 = envelopeRequestParser<TransactionEvent>(transaction1Req);
const transaction2 = envelopeRequestParser<TransactionEvent>(transaction2Req);

expect(transaction1).toBeDefined();
expect(transaction2).toBeDefined();

const trace1Id = transaction1.contexts?.trace?.trace_id;
const trace2Id = transaction2.contexts?.trace?.trace_id;

expect(trace1Id).toBe('12345678901234567890123456789012');
expect(trace2Id).toBe('12345678901234567890123456789012');

expect(transaction1.contexts?.trace?.parent_span_id).toBe('1234567890123456');
expect(transaction2.contexts?.trace?.parent_span_id).toBe('1234567890123456');
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sentry.startSpan({ name: 'test_span_1' }, () => undefined);
Sentry.startSpan({ name: 'test_span_2' }, () => undefined);
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { expect } from '@playwright/test';

import type { TransactionEvent } from '@sentry/types';
import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, shouldSkipTracingTest, waitForTransactionRequest } from '../../../../utils/helpers';

sentryTest('should send manually started parallel root spans in root context', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

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

const transaction1ReqPromise = waitForTransactionRequest(page, event => event.transaction === 'test_span_1');
const transaction2ReqPromise = waitForTransactionRequest(page, event => event.transaction === 'test_span_2');

await page.goto(url);

const [transaction1Req, transaction2Req] = await Promise.all([transaction1ReqPromise, transaction2ReqPromise]);

const transaction1 = envelopeRequestParser<TransactionEvent>(transaction1Req);
const transaction2 = envelopeRequestParser<TransactionEvent>(transaction2Req);

expect(transaction1).toBeDefined();
expect(transaction2).toBeDefined();

const trace1Id = transaction1.contexts?.trace?.trace_id;
const trace2Id = transaction2.contexts?.trace?.trace_id;

expect(trace1Id).toBeDefined();
expect(trace2Id).toBeDefined();

// We use the same traceID from the root propagation context here
expect(trace1Id).toBe(trace2Id);

expect(transaction1.contexts?.trace?.parent_span_id).toBeUndefined();
expect(transaction2.contexts?.trace?.parent_span_id).toBeUndefined();
});
16 changes: 14 additions & 2 deletions dev-packages/browser-integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
Event,
EventEnvelope,
EventEnvelopeHeaders,
TransactionEvent,
} from '@sentry/types';

export const envelopeUrlRegex = /\.sentry\.io\/api\/\d+\/envelope\//;
Expand Down Expand Up @@ -224,7 +225,10 @@ export function waitForErrorRequest(page: Page, callback?: (event: Event) => boo
});
}

export function waitForTransactionRequest(page: Page): Promise<Request> {
export function waitForTransactionRequest(
page: Page,
callback?: (event: TransactionEvent) => boolean,
): Promise<Request> {
return page.waitForRequest(req => {
const postData = req.postData();
if (!postData) {
Expand All @@ -234,7 +238,15 @@ export function waitForTransactionRequest(page: Page): Promise<Request> {
try {
const event = envelopeRequestParser(req);

return event.type === 'transaction';
if (event.type !== 'transaction') {
return false;
}

if (callback) {
return callback(event as TransactionEvent);
}

return true;
} catch {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"clean": "rimraf tmp node_modules pnpm-lock.yaml && yarn clean:test-applications",
"ci:build-matrix": "ts-node ./lib/getTestMatrix.ts",
"ci:build-matrix-optional": "ts-node ./lib/getTestMatrix.ts --optional=true",
"clean:test-applications": "rimraf --glob test-applications/**/{node_modules,dist,build,.next,.sveltekit,pnpm-lock.yaml} .last-run.json && pnpm store prune"
"clean:test-applications": "rimraf --glob test-applications/**/{node_modules,dist,build,.next,.sveltekit,pnpm-lock.yaml,.last-run.json,test-results} && pnpm store prune"
},
"devDependencies": {
"@types/glob": "8.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function RedirectDestinationPage() {
return (
<div>
<h1>Redirect Destination</h1>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { redirect } from 'next/navigation';

async function redirectAction() {
'use server';

redirect('/redirect/destination');
}

export default function RedirectOriginPage() {
return (
<>
{/* @ts-ignore */}
<form action={redirectAction}>
<button type="submit">Redirect me</button>
</form>
</>
);
}
Loading
Loading