|
20 | 20 | }, |
21 | 21 | }), |
22 | 22 | ); |
| 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'); |
23 | 41 | ``` |
24 | 42 |
|
25 | 43 | - **feat(vue): Add TanStack Router integration ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))** |
26 | 44 |
|
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: |
28 | 46 |
|
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'; |
34 | 52 |
|
35 | | -const router = createRouter({ |
36 | | - // your router config |
37 | | -}); |
| 53 | + const router = createRouter({ |
| 54 | + // your router config |
| 55 | + }); |
38 | 56 |
|
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 | + ``` |
46 | 64 |
|
47 | 65 | - **feat(nextjs): Add tree-shaking configuration to `webpack` build config ([#18359](https://github.com/getsentry/sentry-javascript/pull/18359))** |
48 | 66 |
|
49 | 67 | - **feat(replay): Add Request body with `attachRawBodyFromRequest` option ([#18501](https://github.com/getsentry/sentry-javascript/pull/18501))** |
50 | 68 |
|
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: |
53 | 71 |
|
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 | + ``` |
63 | 81 |
|
64 | 82 | ## 10.31.0 |
65 | 83 |
|
|
0 commit comments