|
10 | 10 |
|
11 | 11 | - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
|
12 | 12 |
|
| 13 | +## 9.10.0 |
| 14 | + |
| 15 | +### Important Changes |
| 16 | + |
| 17 | +- **feat: Add support for logs** |
| 18 | + |
| 19 | + - feat(node): Add logging public APIs to Node SDKs ([#15764](https://github.com/getsentry/sentry-javascript/pull/15764)) |
| 20 | + - feat(core): Add support for `beforeSendLog` ([#15814](https://github.com/getsentry/sentry-javascript/pull/15814)) |
| 21 | + - feat(core): Add support for parameterizing logs ([#15812](https://github.com/getsentry/sentry-javascript/pull/15812)) |
| 22 | + - fix: Remove critical log severity level ([#15824](https://github.com/getsentry/sentry-javascript/pull/15824)) |
| 23 | + |
| 24 | + All JavaScript SDKs other than `@sentry/cloudflare` and `@sentry/deno` now support sending logs via dedicated methods as part of Sentry's [upcoming logging product](https://github.com/getsentry/sentry/discussions/86804). |
| 25 | + |
| 26 | + Logging is gated by an experimental option, `_experiments.enableLogs`. |
| 27 | + |
| 28 | + ```js |
| 29 | + Sentry.init({ |
| 30 | + dsn: 'PUBLIC_DSN', |
| 31 | + // `enableLogs` must be set to true to use the logging features |
| 32 | + _experiments: { enableLogs: true }, |
| 33 | + }); |
| 34 | + |
| 35 | + const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger; |
| 36 | + |
| 37 | + trace('Starting database connection', { database: 'users' }); |
| 38 | + debug('Cache miss for user', { userId: 123 }); |
| 39 | + error('Failed to process payment', { orderId: 'order_123', amount: 99.99 }); |
| 40 | + fatal('Database connection pool exhausted', { database: 'users', activeConnections: 100 }); |
| 41 | + |
| 42 | + // Structured logging via the `fmt` helper function. When you use `fmt`, the string template and parameters are sent separately so they can be queried independently in Sentry. |
| 43 | + |
| 44 | + info(fmt(`Updated profile for user ${userId}`)); |
| 45 | + warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests: ${requests}, Limit: ${limit}`)); |
| 46 | + ``` |
| 47 | + |
| 48 | + With server-side SDKs like `@sentry/node`, `@sentry/bun` or server-side of `@sentry/nextjs` or `@sentry/sveltekit`, you can do structured logging without needing the `fmt` helper function. |
| 49 | + |
| 50 | + ```js |
| 51 | + const { info, warn } = Sentry.logger; |
| 52 | + |
| 53 | + info('User %s logged in successfully', [123]); |
| 54 | + warn('Failed to load user %s data', [123], { errorCode: 404 }); |
| 55 | + ``` |
| 56 | + |
| 57 | + To filter logs, or update them before they are sent to Sentry, you can use the `_experiments.beforeSendLog` option. |
| 58 | + |
| 59 | +- **feat(browser): Add `diagnoseSdkConnectivity()` function to programmatically detect possible connectivity issues ([#15821](https://github.com/getsentry/sentry-javascript/pull/15821))** |
| 60 | + |
| 61 | + The `diagnoseSdkConnectivity()` function can be used to programmatically detect possible connectivity issues with the Sentry SDK. |
| 62 | + |
| 63 | + ```js |
| 64 | + const result = await Sentry.diagnoseSdkConnectivity(); |
| 65 | + ``` |
| 66 | + |
| 67 | + The result will be an object with the following properties: |
| 68 | + |
| 69 | + - `"no-client-active"`: There was no active client when the function was called. This possibly means that the SDK was not initialized yet. |
| 70 | + - `"sentry-unreachable"`: The Sentry SaaS servers were not reachable. This likely means that there is an ad blocker active on the page or that there are other connection issues. |
| 71 | + - `undefined`: The SDK is working as expected. |
| 72 | + |
| 73 | +- **SDK Tracing Performance Improvements for Node SDKs** |
| 74 | + |
| 75 | + - feat: Stop using `dropUndefinedKeys` ([#15796](https://github.com/getsentry/sentry-javascript/pull/15796)) |
| 76 | + - feat(node): Only add span listeners for instrumentation when used ([#15802](https://github.com/getsentry/sentry-javascript/pull/15802)) |
| 77 | + - ref: Avoid `dropUndefinedKeys` for `spanToJSON` calls ([#15792](https://github.com/getsentry/sentry-javascript/pull/15792)) |
| 78 | + - ref: Avoid using `SentryError` for PromiseBuffer control flow ([#15822](https://github.com/getsentry/sentry-javascript/pull/15822)) |
| 79 | + - ref: Stop using `dropUndefinedKeys` in SpanExporter ([#15794](https://github.com/getsentry/sentry-javascript/pull/15794)) |
| 80 | + - ref(core): Avoid using `SentryError` for event processing control flow ([#15823](https://github.com/getsentry/sentry-javascript/pull/15823)) |
| 81 | + - ref(node): Avoid `dropUndefinedKeys` in Node SDK init ([#15797](https://github.com/getsentry/sentry-javascript/pull/15797)) |
| 82 | + - ref(opentelemetry): Avoid sampling work for non-root spans ([#15820](https://github.com/getsentry/sentry-javascript/pull/15820)) |
| 83 | + |
| 84 | + We've been hard at work making performance improvements to the Sentry Node SDKs (`@sentry/node`, `@sentry/aws-serverless`, `@sentry/nestjs`, etc.). We've seen that upgrading from `9.7.0` to `9.10.0` leads to 30-40% improvement in request latency for HTTP web-server applications that use tracing with high sample rates. Non web-server applications and non-tracing applications will see smaller improvements. |
| 85 | + |
| 86 | +### Other Changes |
| 87 | + |
| 88 | +- chore(deps): Bump `rrweb` to `2.35.0` ([#15825](https://github.com/getsentry/sentry-javascript/pull/15825)) |
| 89 | +- deps: Bump bundler plugins to `3.2.3` ([#15829](https://github.com/getsentry/sentry-javascript/pull/15829)) |
| 90 | +- feat: Always truncate stored breadcrumb messages to 2kb ([#15819](https://github.com/getsentry/sentry-javascript/pull/15819)) |
| 91 | +- feat(nextjs): Disable server webpack-handling for static builds ([#15751](https://github.com/getsentry/sentry-javascript/pull/15751)) |
| 92 | +- fix(nuxt): Don't override Nuxt options if undefined ([#15795](https://github.com/getsentry/sentry-javascript/pull/15795)) |
| 93 | + |
13 | 94 | ## 9.9.0
|
14 | 95 |
|
15 | 96 | ### Important Changes
|
|
42 | 123 |
|
43 | 124 | - **feat(browser): Add `logger.X` methods to browser SDK ([#15763](https://github.com/getsentry/sentry-javascript/pull/15763))**
|
44 | 125 |
|
45 |
| - For Sentry's [upcoming logging product](https://github.com/getsentry/sentry/discussions/86804), the SDK now supports sending logs via dedicated |
| 126 | + For Sentry's [upcoming logging product](https://github.com/getsentry/sentry/discussions/86804), the SDK now supports sending logs via dedicated methods. |
46 | 127 |
|
47 | 128 | ```js
|
48 | 129 | Sentry.init({
|
|
0 commit comments