@sentry/react
Advanced tools
Changelog
9.42.1
globalThis
(#17185)handleErrorWithSentry
(#17174)Changelog
9.41.0
enableLogs
and beforeSendLog
option (#17092)Sentry now has support for structured logging. Previously to enable structured logging, you had to use the _experiments.enableLogs
and _experiments.beforeSendLog
options. These options have been deprecated in favor of the top-level enableLogs
and beforeSendLog
options.
// before
Sentry.init({
_experiments: {
enableLogs: true,
beforeSendLog: log => {
return log;
},
},
});
// after
Sentry.init({
enableLogs: true,
beforeSendLog: log => {
return log;
},
});
Server-side and client-side parameterized routes are now supported in the Astro SDK. No configuration changes are required.
vercelAiIntegration
have correct trace (#17142)Work in this release was contributed by @richardjelinek-fastest. Thank you for your contribution!
Changelog
9.40.0
This release adds two Browser SDK APIs to let the main thread know about debugIds of worker files:
webWorkerIntegration({worker})
to be used in the main threadregisterWebWorker({self})
to be used in the web worker// main.js
Sentry.init({...})
const worker = new MyWorker(...);
Sentry.addIntegration(Sentry.webWorkerIntegration({ worker }));
worker.addEventListener('message', e => {...});
// worker.js
Sentry.registerWebWorker({ self });
self.postMessage(...);
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.
import { logger, debug } from '@sentry/core';
// before
logger.info('This is an info message');
// after
debug.log('This is an info message');
This release adds official support for instrumenting OpenAI SDK calls in with Sentry tracing, following OpenTelemetry semantic conventions for Generative AI. It instruments:
client.chat.completions.create()
- For chat-based completionsclient.responses.create()
- For the responses API// The integration respects your `sendDefaultPii` option, but you can override the behavior in the integration options
Sentry.init({
dsn: '__DSN__',
integrations: [
Sentry.openAIIntegration({
recordInputs: true, // Force recording prompts
recordOutputs: true, // Force recording responses
}),
],
});
@opentelemetry/instrumentation
range to cover 0.203.0
(#17043)Work in this release was contributed by @0xbad0c0d3 and @tommy-gilligan. Thank you for your contributions!