Skip to content

Commit 7c6a3eb

Browse files
authored
Merge branch 'develop' into nh/tss-wrapfetchwithsentry-changelog
2 parents 0d58784 + ea3a45f commit 7c6a3eb

1 file changed

Lines changed: 45 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,64 @@
2020
},
2121
}),
2222
);
23+
24+
- **feat(core): Apply scope attributes to logs** ([18184](https://github.com/getsentry/sentry-javascript/pull/18184))
25+
26+
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.
27+
28+
```ts
29+
Sentry.geGlobalScope().setAttributes({ is_admin: true, auth_provider: 'google' });
30+
31+
Sentry.withScope(scope => {
32+
scope.setAttribute('step', 'authentication');
33+
34+
// scope attributes `is_admin`, `auth_provider` and `step` are added
35+
Sentry.logger.info(`user ${user.id} logged in`, { activeSince: 100 });
36+
Sentry.logger.info(`updated ${user.id} last activity`);
37+
});
38+
39+
// scope attributes `is_admin` and `auth_provider` are added
40+
Sentry.logger.warn('stale website version, reloading page');
2341
```
2442

2543
- **feat(vue): Add TanStack Router integration ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))**
2644

27-
The `@sentry/vue` package now includes support for TanStack Router. Use `tanstackRouterBrowserTracingIntegration` to automatically instrument pageload and navigation transactions with parameterized routes:
45+
The `@sentry/vue` package now includes support for TanStack Router. Use `tanstackRouterBrowserTracingIntegration` to automatically instrument pageload and navigation transactions with parameterized routes:
2846

29-
```javascript
30-
import { createApp } from 'vue';
31-
import { createRouter } from '@tanstack/vue-router';
32-
import * as Sentry from '@sentry/vue';
33-
import { tanstackRouterBrowserTracingIntegration } from '@sentry/vue/tanstackrouter';
47+
```javascript
48+
import { createApp } from 'vue';
49+
import { createRouter } from '@tanstack/vue-router';
50+
import * as Sentry from '@sentry/vue';
51+
import { tanstackRouterBrowserTracingIntegration } from '@sentry/vue/tanstackrouter';
3452

35-
const router = createRouter({
36-
// your router config
37-
});
53+
const router = createRouter({
54+
// your router config
55+
});
3856

39-
Sentry.init({
40-
app,
41-
dsn: '__PUBLIC_DSN__',
42-
integrations: [tanstackRouterBrowserTracingIntegration(router)],
43-
tracesSampleRate: 1.0,
44-
});
45-
```
57+
Sentry.init({
58+
app,
59+
dsn: '__PUBLIC_DSN__',
60+
integrations: [tanstackRouterBrowserTracingIntegration(router)],
61+
tracesSampleRate: 1.0,
62+
});
63+
```
4664

4765
- **feat(nextjs): Add tree-shaking configuration to `webpack` build config ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))**
4866

4967
- **feat(replay): Add Request body with `attachRawBodyFromRequest` option ([#18501](https://github.com/getsentry/sentry-javascript/pull/18501))**
5068

51-
To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events,
52-
you can now use the `attachRawBodyFromRequest` option in the Replay integration:
69+
To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events,
70+
you can now use the `attachRawBodyFromRequest` option in the Replay integration:
5371

54-
```js
55-
Sentry.init({
56-
integrations: [
57-
Sentry.replayIntegration({
58-
attachRawBodyFromRequest: true,
59-
}),
60-
],
61-
});
62-
```
72+
```js
73+
Sentry.init({
74+
integrations: [
75+
Sentry.replayIntegration({
76+
attachRawBodyFromRequest: true,
77+
}),
78+
],
79+
});
80+
```
6381

6482
## 10.31.0
6583

0 commit comments

Comments
 (0)