|
4 | 4 |
|
5 | 5 | - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott |
6 | 6 |
|
| 7 | +- **feat(core): Apply scope attributes to logs** ([18184](https://github.com/getsentry/sentry-javascript/pull/18184)) |
| 8 | + |
| 9 | + 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. |
| 10 | + |
| 11 | + ```ts |
| 12 | + Sentry.geGlobalScope().setAttributes({ is_admin: true, auth_provider: 'google' }); |
| 13 | + |
| 14 | + Sentry.withScope(scope => { |
| 15 | + scope.setAttribute('step', 'authentication'); |
| 16 | + |
| 17 | + // scope attributes `is_admin`, `auth_provider` and `step` are added |
| 18 | + Sentry.logger.info(`user ${user.id} logged in`, { activeSince: 100 }); |
| 19 | + Sentry.logger.info(`updated ${user.id} last activity`); |
| 20 | + }); |
| 21 | + |
| 22 | + // scope attributes `is_admin` and `auth_provider` are added |
| 23 | + Sentry.logger.warn('stale website version, reloading page'); |
| 24 | + ``` |
| 25 | + |
7 | 26 | - **feat(vue): Add TanStack Router integration ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))** |
8 | 27 |
|
9 | | -The `@sentry/vue` package now includes support for TanStack Router. Use `tanstackRouterBrowserTracingIntegration` to automatically instrument pageload and navigation transactions with parameterized routes: |
| 28 | + The `@sentry/vue` package now includes support for TanStack Router. Use `tanstackRouterBrowserTracingIntegration` to automatically instrument pageload and navigation transactions with parameterized routes: |
10 | 29 |
|
11 | | -```javascript |
12 | | -import { createApp } from 'vue'; |
13 | | -import { createRouter } from '@tanstack/vue-router'; |
14 | | -import * as Sentry from '@sentry/vue'; |
15 | | -import { tanstackRouterBrowserTracingIntegration } from '@sentry/vue/tanstackrouter'; |
| 30 | + ```javascript |
| 31 | + import { createApp } from 'vue'; |
| 32 | + import { createRouter } from '@tanstack/vue-router'; |
| 33 | + import * as Sentry from '@sentry/vue'; |
| 34 | + import { tanstackRouterBrowserTracingIntegration } from '@sentry/vue/tanstackrouter'; |
16 | 35 |
|
17 | | -const router = createRouter({ |
18 | | - // your router config |
19 | | -}); |
| 36 | + const router = createRouter({ |
| 37 | + // your router config |
| 38 | + }); |
20 | 39 |
|
21 | | -Sentry.init({ |
22 | | - app, |
23 | | - dsn: '__PUBLIC_DSN__', |
24 | | - integrations: [tanstackRouterBrowserTracingIntegration(router)], |
25 | | - tracesSampleRate: 1.0, |
26 | | -}); |
27 | | -``` |
| 40 | + Sentry.init({ |
| 41 | + app, |
| 42 | + dsn: '__PUBLIC_DSN__', |
| 43 | + integrations: [tanstackRouterBrowserTracingIntegration(router)], |
| 44 | + tracesSampleRate: 1.0, |
| 45 | + }); |
| 46 | + ``` |
28 | 47 |
|
29 | 48 | - **feat(nextjs): Add tree-shaking configuration to `webpack` build config ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))** |
30 | 49 |
|
31 | 50 | - **feat(replay): Add Request body with `attachRawBodyFromRequest` option ([#18501](https://github.com/getsentry/sentry-javascript/pull/18501))** |
32 | 51 |
|
33 | | -To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events, |
34 | | -you can now use the `attachRawBodyFromRequest` option in the Replay integration: |
| 52 | + To attach the raw request body (from `Request` objects passed as the first `fetch` argument) to replay events, |
| 53 | + you can now use the `attachRawBodyFromRequest` option in the Replay integration: |
35 | 54 |
|
36 | | -```js |
37 | | -Sentry.init({ |
38 | | - integrations: [ |
39 | | - Sentry.replayIntegration({ |
40 | | - attachRawBodyFromRequest: true, |
41 | | - }), |
42 | | - ], |
43 | | -}); |
44 | | -``` |
| 55 | + ```js |
| 56 | + Sentry.init({ |
| 57 | + integrations: [ |
| 58 | + Sentry.replayIntegration({ |
| 59 | + attachRawBodyFromRequest: true, |
| 60 | + }), |
| 61 | + ], |
| 62 | + }); |
| 63 | + ``` |
45 | 64 |
|
46 | 65 | ## 10.31.0 |
47 | 66 |
|
|
0 commit comments