|
4 | 4 |
|
5 | 5 | - "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
|
6 | 6 |
|
| 7 | +## 9.40.0 |
| 8 | + |
| 9 | +### Important Changes |
| 10 | + |
| 11 | +- **feat(browser): Add debugId sync APIs between web worker and main thread ([#16981](https://github.com/getsentry/sentry-javascript/pull/16981))** |
| 12 | + |
| 13 | +This release adds two Browser SDK APIs to let the main thread know about debugIds of worker files: |
| 14 | + |
| 15 | +- `webWorkerIntegration({worker})` to be used in the main thread |
| 16 | +- `registerWebWorker({self})` to be used in the web worker |
| 17 | + |
| 18 | +```js |
| 19 | +// main.js |
| 20 | +Sentry.init({...}) |
| 21 | + |
| 22 | +const worker = new MyWorker(...); |
| 23 | + |
| 24 | +Sentry.addIntegration(Sentry.webWorkerIntegration({ worker })); |
| 25 | + |
| 26 | +worker.addEventListener('message', e => {...}); |
| 27 | +``` |
| 28 | + |
| 29 | +```js |
| 30 | +// worker.js |
| 31 | +Sentry.registerWebWorker({ self }); |
| 32 | + |
| 33 | +self.postMessage(...); |
| 34 | +``` |
| 35 | + |
| 36 | +- **feat(core): Deprecate logger in favor of debug ([#17040](https://github.com/getsentry/sentry-javascript/pull/17040))** |
| 37 | + |
| 38 | +The internal SDK `logger` export from `@sentry/core` has been deprecated in favor of the `debug` export. `debug` only exposes `log`, `warn`, and `error` methods but is otherwise identical to `logger`. Note that this deprecation does not affect the `logger` export from other packages (like `@sentry/browser` or `@sentry/node`) which is used for Sentry Logging. |
| 39 | + |
| 40 | +```js |
| 41 | +import { logger, debug } from '@sentry/core'; |
| 42 | + |
| 43 | +// before |
| 44 | +logger.info('This is an info message'); |
| 45 | + |
| 46 | +// after |
| 47 | +debug.log('This is an info message'); |
| 48 | +``` |
| 49 | + |
| 50 | +- **feat(node): Add OpenAI integration ([#17022](https://github.com/getsentry/sentry-javascript/pull/17022))** |
| 51 | + |
| 52 | +This release adds official support for instrumenting OpenAI SDK calls in with Sentry tracing, following OpenTelemetry semantic conventions for Generative AI. It instruments: |
| 53 | + |
| 54 | +- `client.chat.completions.create()` - For chat-based completions |
| 55 | +- `client.responses.create()` - For the responses API |
| 56 | + |
| 57 | +```js |
| 58 | +// The integration respects your `sendDefaultPii` option, but you can override the behavior in the integration options |
| 59 | + |
| 60 | +Sentry.init({ |
| 61 | + dsn: '__DSN__', |
| 62 | + integrations: [ |
| 63 | + Sentry.openAIIntegration({ |
| 64 | + recordInputs: true, // Force recording prompts |
| 65 | + recordOutputs: true, // Force recording responses |
| 66 | + }), |
| 67 | + ], |
| 68 | +}); |
| 69 | +``` |
| 70 | + |
| 71 | +### Other Changes |
| 72 | + |
| 73 | +- feat(node-core): Expand `@opentelemetry/instrumentation` range to cover `0.203.0` ([#17043](https://github.com/getsentry/sentry-javascript/pull/17043)) |
| 74 | +- fix(cloudflare): Ensure errors get captured from durable objects ([#16838](https://github.com/getsentry/sentry-javascript/pull/16838)) |
| 75 | +- fix(sveltekit): Ensure server errors from streamed responses are sent ([#17044](https://github.com/getsentry/sentry-javascript/pull/17044)) |
| 76 | + |
7 | 77 | Work in this release was contributed by @0xbad0c0d3 and @tommy-gilligan. Thank you for your contributions!
|
8 | 78 |
|
9 | 79 | ## 9.39.0
|
|
0 commit comments