Skip to content

Commit 445b682

Browse files
authored
Merge pull request #18560 from getsentry/prepare-release/10.32.0
meta(changelog): Update changelog for 10.32.0
2 parents 03f5f6a + b21806c commit 445b682

File tree

101 files changed

+4058
-773
lines changed

Some content is hidden

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

101 files changed

+4058
-773
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ Before submitting a pull request, please take a look at our
33

44
- [ ] If you've added code that should be tested, please add tests.
55
- [ ] Ensure your code lints and the test suite passes (`yarn lint`) & (`yarn test`).
6+
- [ ] Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.
7+
8+
Closes #issue_link_here

.size-limit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = [
5252
path: 'packages/browser/build/npm/esm/prod/index.js',
5353
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
5454
gzip: true,
55-
limit: '80 KB',
55+
limit: '82 KB',
5656
},
5757
{
5858
name: '@sentry/browser (incl. Tracing, Replay) - with treeshaking flags',
@@ -89,7 +89,7 @@ module.exports = [
8989
path: 'packages/browser/build/npm/esm/prod/index.js',
9090
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'feedbackIntegration'),
9191
gzip: true,
92-
limit: '97 KB',
92+
limit: '98 KB',
9393
},
9494
{
9595
name: '@sentry/browser (incl. Feedback)',
@@ -213,7 +213,7 @@ module.exports = [
213213
import: createImport('init'),
214214
ignore: ['next/router', 'next/constants'],
215215
gzip: true,
216-
limit: '46 KB',
216+
limit: '46.5 KB',
217217
},
218218
// SvelteKit SDK (ESM)
219219
{

CHANGELOG.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,105 @@
44

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

7+
## 10.32.0
8+
9+
### Important Changes
10+
11+
- **feat(core): Apply scope attributes to logs ([#18184](https://github.com/getsentry/sentry-javascript/pull/18184))**
12+
13+
You can now set attributes on the SDK's scopes which will be applied to all logs as long as the respective scopes are active. For the time being, only `string`, `number` and `boolean` attribute values are supported.
14+
15+
```ts
16+
Sentry.geGlobalScope().setAttributes({ is_admin: true, auth_provider: 'google' });
17+
18+
Sentry.withScope(scope => {
19+
scope.setAttribute('step', 'authentication');
20+
21+
// scope attributes `is_admin`, `auth_provider` and `step` are added
22+
Sentry.logger.info(`user ${user.id} logged in`, { activeSince: 100 });
23+
Sentry.logger.info(`updated ${user.id} last activity`);
24+
});
25+
26+
// scope attributes `is_admin` and `auth_provider` are added
27+
Sentry.logger.warn('stale website version, reloading page');
28+
```
29+
30+
- **feat(replay): Add Request body with `attachRawBodyFromRequest` option ([#18501](https://github.com/getsentry/sentry-javascript/pull/18501))**
31+
32+
To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events, you can now use the `attachRawBodyFromRequest` option in the Replay integration:
33+
34+
```js
35+
Sentry.init({
36+
integrations: [
37+
Sentry.replayIntegration({
38+
attachRawBodyFromRequest: true,
39+
}),
40+
],
41+
});
42+
```
43+
44+
- **feat(tanstackstart-react): Trace server functions ([#18500](https://github.com/getsentry/sentry-javascript/pull/18500))**
45+
46+
To enable tracing for server-side requests, you can now explicitly define a [server entry point](https://tanstack.com/start/latest/docs/framework/react/guide/server-entry-point) in your application and wrap your request handler with `wrapFetchWithSentry`.
47+
48+
```typescript
49+
// src/server.ts
50+
import { wrapFetchWithSentry } from '@sentry/tanstackstart-react';
51+
import handler, { createServerEntry } from '@tanstack/react-start/server-entry';
52+
53+
export default createServerEntry(
54+
wrapFetchWithSentry({
55+
fetch(request: Request) {
56+
return handler.fetch(request);
57+
},
58+
}),
59+
);
60+
```
61+
62+
- **feat(vue): Add TanStack Router integration ([#18547](https://github.com/getsentry/sentry-javascript/pull/18547))**
63+
64+
The `@sentry/vue` package now includes support for TanStack Router. Use `tanstackRouterBrowserTracingIntegration` to automatically instrument pageload and navigation transactions with parameterized routes:
65+
66+
```javascript
67+
import { createApp } from 'vue';
68+
import { createRouter } from '@tanstack/vue-router';
69+
import * as Sentry from '@sentry/vue';
70+
import { tanstackRouterBrowserTracingIntegration } from '@sentry/vue/tanstackrouter';
71+
72+
const router = createRouter({
73+
// your router config
74+
});
75+
76+
Sentry.init({
77+
app,
78+
dsn: '__PUBLIC_DSN__',
79+
integrations: [tanstackRouterBrowserTracingIntegration(router)],
80+
tracesSampleRate: 1.0,
81+
});
82+
```
83+
84+
### Other Changes
85+
86+
- feat(core): Capture initialize attributes on MCP servers ([#18531](https://github.com/getsentry/sentry-javascript/pull/18531))
87+
- feat(nextjs): Extract tracing logic from server component wrapper templates ([#18408](https://github.com/getsentry/sentry-javascript/pull/18408))
88+
- feat(nextjs): added webpack treeshaking flags as config ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))
89+
- fix(solid/tanstackrouter): Ensure web vitals are sent on pageload ([#18542](https://github.com/getsentry/sentry-javascript/pull/18542))
90+
91+
<details>
92+
<summary> <strong>Internal Changes</strong> </summary>
93+
94+
- chore(changelog): Add entry for scope attributes ([#18555](https://github.com/getsentry/sentry-javascript/pull/18555))
95+
- chore(changelog): Add entry for tanstack start wrapFetchWithSentry ([#18558](https://github.com/getsentry/sentry-javascript/pull/18558))
96+
- chore(deps): bump @trpc/server from 10.45.2 to 10.45.3 in /dev-packages/e2e-tests/test-applications/node-express-incorrect-instrumentation ([#18530](https://github.com/getsentry/sentry-javascript/pull/18530))
97+
- chore(deps): bump @trpc/server from 10.45.2 to 10.45.3 in /dev-packages/e2e-tests/test-applications/node-express-v5 ([#18550](https://github.com/getsentry/sentry-javascript/pull/18550))
98+
- chore(e2e): Pin to react-router 7.10.1 in spa e2e test ([#18548](https://github.com/getsentry/sentry-javascript/pull/18548))
99+
- chore(e2e): Remove check on `http.response_content_length_uncompressed` ([#18536](https://github.com/getsentry/sentry-javascript/pull/18536))
100+
- chore(github): Add "Closes" to PR template ([#18538](https://github.com/getsentry/sentry-javascript/pull/18538))
101+
- test(cloudflare-mcp): Unpin mcp sdk ([#18528](https://github.com/getsentry/sentry-javascript/pull/18528))
102+
- test(nextjs): Add e2e tests for server component spans in next 16 ([#18544](https://github.com/getsentry/sentry-javascript/pull/18544))
103+
104+
</details>
105+
7106
## 10.31.0
8107

9108
### Important Changes

dev-packages/browser-integration-tests/suites/public-api/logger/integration/test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { expect } from '@playwright/test';
22
import type { LogEnvelope } from '@sentry/core';
33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';
4+
import {
5+
getFirstSentryEnvelopeRequest,
6+
properFullEnvelopeRequestParser,
7+
testingCdnBundle,
8+
} from '../../../../utils/helpers';
59

610
sentryTest('should capture console object calls', async ({ getLocalTestUrl, page }) => {
7-
const bundle = process.env.PW_BUNDLE || '';
811
// Only run this for npm package exports
9-
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
10-
sentryTest.skip();
11-
}
12+
sentryTest.skip(testingCdnBundle());
1213

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// only log attribute
2+
Sentry.logger.info('log_before_any_scope', { log_attr: 'log_attr_1' });
3+
4+
Sentry.getGlobalScope().setAttributes({ global_scope_attr: true });
5+
6+
// this attribute will not be sent for now
7+
Sentry.getGlobalScope().setAttribute('array_attr', [1, 2, 3]);
8+
9+
// global scope, log attribute
10+
Sentry.logger.info('log_after_global_scope', { log_attr: 'log_attr_2' });
11+
12+
Sentry.withIsolationScope(isolationScope => {
13+
isolationScope.setAttribute('isolation_scope_1_attr', { value: 100, unit: 'millisecond' });
14+
15+
// global scope, isolation scope, log attribute
16+
Sentry.logger.info('log_with_isolation_scope', { log_attr: 'log_attr_3' });
17+
18+
Sentry.withScope(scope => {
19+
scope.setAttributes({ scope_attr: { value: 200, unit: 'millisecond' } });
20+
21+
// global scope, isolation scope, current scope attribute, log attribute
22+
Sentry.logger.info('log_with_scope', { log_attr: 'log_attr_4' });
23+
});
24+
25+
Sentry.withScope(scope2 => {
26+
scope2.setAttribute('scope_2_attr', { value: 300, unit: 'millisecond' });
27+
28+
// global scope, isolation scope, current scope attribute, log attribute
29+
Sentry.logger.info('log_with_scope_2', { log_attr: 'log_attr_5' });
30+
});
31+
});
32+
33+
Sentry.flush();
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import { expect } from '@playwright/test';
2+
import type { LogEnvelope } from '@sentry/core';
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import {
5+
getFirstSentryEnvelopeRequest,
6+
properFullEnvelopeRequestParser,
7+
testingCdnBundle,
8+
} from '../../../../utils/helpers';
9+
10+
sentryTest('captures logs with scope attributes', async ({ getLocalTestUrl, page }) => {
11+
sentryTest.skip(testingCdnBundle());
12+
13+
const url = await getLocalTestUrl({ testDir: __dirname });
14+
15+
const event = await getFirstSentryEnvelopeRequest<LogEnvelope>(page, url, properFullEnvelopeRequestParser);
16+
const envelopeItems = event[1];
17+
18+
expect(envelopeItems[0]).toEqual([
19+
{
20+
type: 'log',
21+
item_count: 5,
22+
content_type: 'application/vnd.sentry.items.log+json',
23+
},
24+
{
25+
items: [
26+
{
27+
timestamp: expect.any(Number),
28+
level: 'info',
29+
body: 'log_before_any_scope',
30+
severity_number: 9,
31+
trace_id: expect.any(String),
32+
attributes: {
33+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
34+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
35+
log_attr: { value: 'log_attr_1', type: 'string' },
36+
},
37+
},
38+
{
39+
timestamp: expect.any(Number),
40+
level: 'info',
41+
body: 'log_after_global_scope',
42+
severity_number: 9,
43+
trace_id: expect.any(String),
44+
attributes: {
45+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
46+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
47+
global_scope_attr: { value: true, type: 'boolean' },
48+
log_attr: { value: 'log_attr_2', type: 'string' },
49+
},
50+
},
51+
{
52+
timestamp: expect.any(Number),
53+
level: 'info',
54+
body: 'log_with_isolation_scope',
55+
severity_number: 9,
56+
trace_id: expect.any(String),
57+
attributes: {
58+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
59+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
60+
global_scope_attr: { value: true, type: 'boolean' },
61+
isolation_scope_1_attr: { value: 100, unit: 'millisecond', type: 'integer' },
62+
log_attr: { value: 'log_attr_3', type: 'string' },
63+
},
64+
},
65+
{
66+
timestamp: expect.any(Number),
67+
level: 'info',
68+
body: 'log_with_scope',
69+
severity_number: 9,
70+
trace_id: expect.any(String),
71+
attributes: {
72+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
73+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
74+
global_scope_attr: { value: true, type: 'boolean' },
75+
isolation_scope_1_attr: { value: 100, unit: 'millisecond', type: 'integer' },
76+
scope_attr: { value: 200, unit: 'millisecond', type: 'integer' },
77+
log_attr: { value: 'log_attr_4', type: 'string' },
78+
},
79+
},
80+
{
81+
timestamp: expect.any(Number),
82+
level: 'info',
83+
body: 'log_with_scope_2',
84+
severity_number: 9,
85+
trace_id: expect.any(String),
86+
attributes: {
87+
'sentry.sdk.name': { value: 'sentry.javascript.browser', type: 'string' },
88+
'sentry.sdk.version': { value: expect.any(String), type: 'string' },
89+
global_scope_attr: { value: true, type: 'boolean' },
90+
isolation_scope_1_attr: { value: 100, unit: 'millisecond', type: 'integer' },
91+
scope_2_attr: { value: 300, unit: 'millisecond', type: 'integer' },
92+
log_attr: { value: 'log_attr_5', type: 'string' },
93+
},
94+
},
95+
],
96+
},
97+
]);
98+
});

dev-packages/browser-integration-tests/suites/public-api/logger/simple/test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { expect } from '@playwright/test';
22
import type { LogEnvelope } from '@sentry/core';
33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getFirstSentryEnvelopeRequest, properFullEnvelopeRequestParser } from '../../../../utils/helpers';
4+
import {
5+
getFirstSentryEnvelopeRequest,
6+
properFullEnvelopeRequestParser,
7+
testingCdnBundle,
8+
} from '../../../../utils/helpers';
59

610
sentryTest('should capture all logging methods', async ({ getLocalTestUrl, page }) => {
7-
const bundle = process.env.PW_BUNDLE || '';
811
// Only run this for npm package exports
9-
if (bundle.startsWith('bundle') || bundle.startsWith('loader')) {
10-
sentryTest.skip();
11-
}
12+
sentryTest.skip(testingCdnBundle());
1213

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
window.Replay = Sentry.replayIntegration({
5+
flushMinDelay: 200,
6+
flushMaxDelay: 200,
7+
minReplayDuration: 0,
8+
9+
networkDetailAllowUrls: ['http://sentry-test.io/foo'],
10+
networkCaptureBodies: true,
11+
attachRawBodyFromRequest: true,
12+
});
13+
14+
Sentry.init({
15+
dsn: 'https://[email protected]/1337',
16+
sampleRate: 1,
17+
// We ensure to sample for errors, so by default nothing is sent
18+
replaysSessionSampleRate: 0.0,
19+
replaysOnErrorSampleRate: 1.0,
20+
21+
integrations: [window.Replay],
22+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<h1>attachRawBodyFromRequest Test</h1>
8+
</body>
9+
</html>
10+

0 commit comments

Comments
 (0)