Skip to content

Commit 6cff022

Browse files
author
Luca Forstner
authored
Merge branch 'develop' into lforst-deprecate-aoti
2 parents 810c78e + 42d045c commit 6cff022

File tree

91 files changed

+831
-481
lines changed

Some content is hidden

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

91 files changed

+831
-481
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
fail-on-severity: 'high'
22
allow-ghsas:
33
# dependency review does not allow specific file exclusions
4-
# we use an older version of NextJS in our tests and thus need to
4+
# we use an older version of NextJS in our tests and thus need to
55
# exclude this
66
# once our minimum supported version is over 14.1.1 this can be removed
77
- GHSA-fr5h-rqp8-mj6g
8+
# we need this for an E2E test for the minimum required version of Nuxt 3.7.0
9+
- GHSA-v784-fjjh-f8r4

CHANGELOG.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,99 @@
1010

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

13-
Work in this release was contributed by @NEKOYASAN. Thank you for your contribution!
13+
## 8.41.0
14+
15+
### Important Changes
16+
17+
- **meta(nuxt): Require minimum Nuxt v3.7.0 ([#14473](https://github.com/getsentry/sentry-javascript/pull/14473))**
18+
19+
We formalized that the Nuxt SDK is at minimum compatible with Nuxt version 3.7.0 and above.
20+
Additionally, the SDK requires the implicit `nitropack` dependency to satisfy version `^2.6.1` and `ofetch` to satisfy `^1.3.3`.
21+
It is recommended to check your lock-files and manually upgrade these dependencies if they don't match the version ranges.
22+
23+
### Deprecations
24+
25+
We are deprecating a few APIs which will be removed in the next major.
26+
27+
The following deprecations will _potentially_ affect you:
28+
29+
- **feat(core): Update & deprecate `undefined` option handling ([#14450](https://github.com/getsentry/sentry-javascript/pull/14450))**
30+
31+
In the next major version we will change how passing `undefined` to `tracesSampleRate` / `tracesSampler` / `enableTracing` will behave.
32+
33+
Currently, doing the following:
34+
35+
```ts
36+
Sentry.init({
37+
tracesSampleRate: undefined,
38+
});
39+
```
40+
41+
Will result in tracing being _enabled_ (although no spans will be generated) because the `tracesSampleRate` key is present in the options object.
42+
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.
43+
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.
44+
45+
The same applies to `tracesSampler` and `enableTracing`.
46+
47+
- **feat(core): Log warnings when returning `null` in `beforeSendSpan` ([#14433](https://github.com/getsentry/sentry-javascript/pull/14433))**
48+
49+
Currently, the `beforeSendSpan` option in `Sentry.init()` allows you to drop individual spans from a trace by returning `null` from the hook.
50+
Since this API lends itself to creating "gaps" inside traces, we decided to change how this API will work in the next major version.
51+
52+
With the next major version the `beforeSendSpan` API can only be used to mutate spans, but no longer to drop them.
53+
With this release the SDK will warn you if you are using this API to drop spans.
54+
Instead, it is recommended to configure instrumentation (i.e. integrations) directly to control what spans are created.
55+
56+
Additionally, with the next major version, root spans will also be passed to `beforeSendSpan`.
57+
58+
- **feat(utils): Deprecate `@sentry/utils` ([#14431](https://github.com/getsentry/sentry-javascript/pull/14431))**
59+
60+
With the next major version the `@sentry/utils` package will be merged into the `@sentry/core` package.
61+
It is therefore no longer recommended to use the `@sentry/utils` package.
62+
63+
- **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))**
64+
65+
Currently it is possible to configure tracing options in various places in the Sentry Vue SDK:
66+
67+
- In `Sentry.init()`
68+
- Inside `tracingOptions` in `Sentry.init()`
69+
- In the `vueIntegration()` options
70+
- Inside `tracingOptions` in the `vueIntegration()` options
71+
72+
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()`.
73+
The other means of configuration will be removed in the next major version of the SDK.
74+
75+
- **feat: Deprecate `registerEsmLoaderHooks.include` and `registerEsmLoaderHooks.exclude` ([#14486](https://github.com/getsentry/sentry-javascript/pull/14486))**
76+
77+
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.
78+
This API served as an escape hatch in case certain modules are incompatible with ESM loader hooks.
79+
80+
Since this API was introduced, a way was found to only wrap modules that there exists instrumentation for (meaning a vetted list).
81+
To only wrap modules that have instrumentation, it is recommended to instead set `registerEsmLoaderHooks.onlyIncludeInstrumentedModules` to `true`.
82+
83+
Note that `onlyIncludeInstrumentedModules: true` will become the default behavior in the next major version and the `registerEsmLoaderHooks` will no longer accept fine-grained options.
84+
85+
The following deprecations will _most likely_ not affect you unless you are building an SDK yourself:
86+
87+
- feat(core): Deprecate `arrayify` ([#14405](https://github.com/getsentry/sentry-javascript/pull/14405))
88+
- feat(core): Deprecate `flatten` ([#14454](https://github.com/getsentry/sentry-javascript/pull/14454))
89+
- feat(core): Deprecate `urlEncode` ([#14406](https://github.com/getsentry/sentry-javascript/pull/14406))
90+
- feat(core): Deprecate `validSeverityLevels` ([#14407](https://github.com/getsentry/sentry-javascript/pull/14407))
91+
- feat(core/utils): Deprecate `getNumberOfUrlSegments` ([#14458](https://github.com/getsentry/sentry-javascript/pull/14458))
92+
- feat(utils): Deprecate `memoBuilder`, `BAGGAGE_HEADER_NAME`, and `makeFifoCache` ([#14434](https://github.com/getsentry/sentry-javascript/pull/14434))
93+
- feat(utils/core): Deprecate `addRequestDataToEvent` and `extractRequestData` ([#14430](https://github.com/getsentry/sentry-javascript/pull/14430))
94+
95+
### Other Changes
96+
97+
- feat: Streamline `sentry-trace`, `baggage` and DSC handling ([#14364](https://github.com/getsentry/sentry-javascript/pull/14364))
98+
- feat(core): Further optimize debug ID parsing ([#14365](https://github.com/getsentry/sentry-javascript/pull/14365))
99+
- feat(node): Add `openTelemetryInstrumentations` option ([#14484](https://github.com/getsentry/sentry-javascript/pull/14484))
100+
- feat(nuxt): Add filter for not found source maps (devtools) ([#14437](https://github.com/getsentry/sentry-javascript/pull/14437))
101+
- feat(nuxt): Only delete public source maps ([#14438](https://github.com/getsentry/sentry-javascript/pull/14438))
102+
- fix(nextjs): Don't report `NEXT_REDIRECT` from browser ([#14440](https://github.com/getsentry/sentry-javascript/pull/14440))
103+
- perf(opentelemetry): Bucket spans for cleanup ([#14154](https://github.com/getsentry/sentry-javascript/pull/14154))
104+
105+
Work in this release was contributed by @NEKOYASAN and @fmorett. Thank you for your contributions!
14106

15107
## 8.40.0
16108

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "8.40.0",
3+
"version": "8.41.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -43,7 +43,7 @@
4343
"@babel/preset-typescript": "^7.16.7",
4444
"@playwright/test": "^1.44.1",
4545
"@sentry-internal/rrweb": "2.29.0",
46-
"@sentry/browser": "8.40.0",
46+
"@sentry/browser": "8.41.0",
4747
"axios": "1.7.7",
4848
"babel-loader": "^8.2.2",
4949
"html-webpack-plugin": "^5.5.0",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
integrations: [Sentry.browserTracingIntegration()],
8+
beforeSendTransaction: transactionEvent => {
9+
const op = transactionEvent.contexts.trace.op;
10+
if (op === 'pageload' || op === 'navigation') {
11+
// use whatever logic you want to set the name
12+
transactionEvent.transaction = 'customName';
13+
14+
transactionEvent.transaction_info.source = 'route';
15+
transactionEvent.contexts.trace.data = {
16+
...transactionEvent.contexts.trace.data,
17+
[Sentry.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
18+
};
19+
}
20+
return transactionEvent;
21+
},
22+
tracesSampleRate: 1,
23+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { expect } from '@playwright/test';
2+
import type { Event } from '@sentry/types';
3+
4+
import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/browser';
5+
import { sentryTest } from '../../../utils/fixtures';
6+
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../utils/helpers';
7+
8+
sentryTest(
9+
'allows modification of the transaction name and source but overwrites source to custom',
10+
async ({ getLocalTestUrl, page }) => {
11+
if (shouldSkipTracingTest()) {
12+
sentryTest.skip();
13+
}
14+
15+
const url = await getLocalTestUrl({ testDir: __dirname });
16+
17+
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
18+
19+
expect(eventData.type).toBe('transaction');
20+
21+
// user-changed name
22+
expect(eventData.transaction).toBe('customName');
23+
24+
// Despite the user setting the source to 'route', the SDK detects that the txn name was changed
25+
// and therefore sets the transaction_info.source to 'custom'. This is not ideal but also not easily changeable.
26+
// Given that Relay doesn't differentiate between 'source' and 'route', we'll keep this as-is for now.
27+
expect(eventData.transaction_info?.source).toBe('custom');
28+
29+
// This stays the same but it has no effect on Relay.
30+
expect(eventData.contexts?.trace?.data?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]).toBe('route');
31+
},
32+
);

dev-packages/bundle-analyzer-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundle-analyzer-scenarios",
3-
"version": "8.40.0",
3+
"version": "8.41.0",
44
"description": "Scenarios to test bundle analysis with",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",

dev-packages/clear-cache-gh-action/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@sentry-internal/clear-cache-gh-action",
33
"description": "An internal Github Action to clear GitHub caches.",
4-
"version": "8.40.0",
4+
"version": "8.41.0",
55
"license": "MIT",
66
"engines": {
77
"node": ">=18"

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/e2e-tests",
3-
"version": "8.40.0",
3+
"version": "8.41.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {

dev-packages/e2e-tests/test-applications/astro-4/tests/errors.server.test.ts

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
import { expect, test } from '@playwright/test';
2-
import { waitForError } from '@sentry-internal/test-utils';
2+
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';
33

44
test.describe('server-side errors', () => {
55
test('captures SSR error', async ({ page }) => {
66
const errorEventPromise = waitForError('astro-4', errorEvent => {
77
return errorEvent?.exception?.values?.[0]?.value === "Cannot read properties of undefined (reading 'x')";
88
});
99

10+
const transactionEventPromise = waitForTransaction('astro-4', transactionEvent => {
11+
return transactionEvent.transaction === 'GET /ssr-error';
12+
});
13+
1014
await page.goto('/ssr-error');
1115

1216
const errorEvent = await errorEventPromise;
17+
const transactionEvent = await transactionEventPromise;
18+
19+
expect(transactionEvent).toMatchObject({
20+
transaction: 'GET /ssr-error',
21+
spans: [],
22+
});
23+
24+
const traceId = transactionEvent.contexts?.trace?.trace_id;
25+
const spanId = transactionEvent.contexts?.trace?.span_id;
26+
27+
expect(traceId).toMatch(/[a-f0-9]{32}/);
28+
expect(spanId).toMatch(/[a-f0-9]{16}/);
29+
expect(transactionEvent.contexts?.trace?.parent_span_id).toBeUndefined();
1330

1431
expect(errorEvent).toMatchObject({
1532
contexts: {
@@ -20,8 +37,8 @@ test.describe('server-side errors', () => {
2037
os: expect.any(Object),
2138
runtime: expect.any(Object),
2239
trace: {
23-
span_id: '', //TODO: This is a bug! We should expect.stringMatching(/[a-f0-9]{16}/) instead of ''
24-
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
40+
span_id: spanId,
41+
trace_id: traceId,
2542
},
2643
},
2744
environment: 'qa',
@@ -69,18 +86,50 @@ test.describe('server-side errors', () => {
6986
const errorEventPromise = waitForError('astro-4', errorEvent => {
7087
return errorEvent?.exception?.values?.[0]?.value === 'Endpoint Error';
7188
});
89+
const transactionEventApiPromise = waitForTransaction('astro-4', transactionEvent => {
90+
return transactionEvent.transaction === 'GET /endpoint-error/api';
91+
});
92+
const transactionEventEndpointPromise = waitForTransaction('astro-4', transactionEvent => {
93+
return transactionEvent.transaction === 'GET /endpoint-error';
94+
});
7295

7396
await page.goto('/endpoint-error');
7497
await page.getByText('Get Data').click();
7598

7699
const errorEvent = await errorEventPromise;
100+
const transactionEventApi = await transactionEventApiPromise;
101+
const transactionEventEndpoint = await transactionEventEndpointPromise;
102+
103+
expect(transactionEventEndpoint).toMatchObject({
104+
transaction: 'GET /endpoint-error',
105+
spans: [],
106+
});
107+
108+
const traceId = transactionEventEndpoint.contexts?.trace?.trace_id;
109+
const endpointSpanId = transactionEventApi.contexts?.trace?.span_id;
110+
111+
expect(traceId).toMatch(/[a-f0-9]{32}/);
112+
expect(endpointSpanId).toMatch(/[a-f0-9]{16}/);
113+
114+
expect(transactionEventApi).toMatchObject({
115+
transaction: 'GET /endpoint-error/api',
116+
spans: [],
117+
});
118+
119+
const spanId = transactionEventApi.contexts?.trace?.span_id;
120+
const parentSpanId = transactionEventApi.contexts?.trace?.parent_span_id;
121+
122+
expect(spanId).toMatch(/[a-f0-9]{16}/);
123+
// TODO: This is incorrect, for whatever reason, it should be the endpointSpanId ideally
124+
expect(parentSpanId).toMatch(/[a-f0-9]{16}/);
125+
expect(parentSpanId).not.toEqual(endpointSpanId);
77126

78127
expect(errorEvent).toMatchObject({
79128
contexts: {
80129
trace: {
81-
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
82-
span_id: expect.stringMatching(/[a-f0-9]{16}/),
83-
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
130+
parent_span_id: parentSpanId,
131+
span_id: spanId,
132+
trace_id: traceId,
84133
},
85134
},
86135
exception: {

dev-packages/e2e-tests/test-applications/nuxt-3-min/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nuxt-3-min",
3-
"description": "E2E test app for the minimum nuxt 3 version our nuxt SDK supports.",
3+
"description": "E2E test app for the minimum Nuxt 3 version our Nuxt SDK supports.",
44
"private": true,
55
"type": "module",
66
"scripts": {
@@ -16,15 +16,15 @@
1616
},
1717
"dependencies": {
1818
"@sentry/nuxt": "latest || *",
19-
"nuxt": "3.13.2"
19+
"nuxt": "3.7.0"
2020
},
2121
"devDependencies": {
2222
"@nuxt/test-utils": "^3.14.1",
2323
"@playwright/test": "^1.44.1",
2424
"@sentry-internal/test-utils": "link:../../../test-utils"
2525
},
2626
"overrides": {
27-
"nitropack": "2.9.7",
28-
"@vercel/nft": "^0.27.4"
27+
"nitropack": "2.10.0",
28+
"ofetch": "1.4.0"
2929
}
3030
}

0 commit comments

Comments
 (0)