docs/changelog/v7.md
Sentry SDK v7 is no longer supported. We recommend migrating to the latest version of the SDK. You can migrate
from v7 of the SDK to v8 by following the migration guide.
Object.assign to be ES5 compatible (#17080)No user-facing changes, only internal changes.
Object.assign to be ES5 compatible (#17080)latest tag (#14926)Work in this release contributed by @LubomirIgonda1. Thank you for your contribution!
_sentryModuleMetadata is not mangled (#14357)Work in this release contributed by @gilisho. Thank you for your contribution!
Work in this release contributed by @gilisho. Thank you for your contribution!
Work in this release contributed by @legobeat. Thank you for your contribution!
window.Sentry (#12579)v7 tag to @sentry/replay (#12304)This release publishes a new AWS Lambda layer under the name SentryNodeServerlessSDKv7 that users still running v7 can
use instead of pinning themselves to SentryNodeServerlessSDK:235.
start() (#12003)lastEventId deprecation warnings (#12042)This release fixes a bug that caused the cumulative layout shift (CLS) web vital not to be reported in a majority of the cases where it should have been reported. With this change, the CLS web vital should now always be reported for pageloads with layout shift. If a pageload did not have layout shift, no CLS web vital should be reported.
Please note that upgrading the SDK to this version may cause data in your dashboards to drastically change.
tunnel support to multiplexed transport (#11851)HTTP_REQUEST_METHOD attribute (#11929)This release adds support for Node 22! 🎉
It also adds prebuilt-binaries for Node 22 to @sentry/profiling-node.
browserTracingIntegration (#11765)Instead of installing @sentry/integrations, you can now import the pluggable integrations directly from your SDK
package:
// Before
import * as Sentry fromv '@sentry/browser';
import { dedupeIntegration } from '@sentry/integrations';
Sentry.init({
integrations: [dedupeIntegration()],
});
// After
import * as Sentry from '@sentry/browser';
Sentry.init({
integrations: [Sentry.dedupeIntegration()],
});
Note that only the functional integrations (e.g. xxxIntegration()) are re-exported.
server.address to browser http.client spans (#11663)browserTracingIntegration (#11647)tunnelRoute matching logic for hybrid cloud (#11577)You can now use a interactionsSampleRate to control the sample rate of INP spans. interactionsSampleRate is applied
on top of the global tracesSampleRate. Therefore if interactionsSampleRate is 0.5 and tracesSampleRate is 0.1,
then the actual sample rate for interactions is 0.05.
Sentry.init({
tracesSampleRate: 0.1,
integrations: [
Sentry.browserTracingIntegration({
interactionsSampleRate: 0.5,
}),
],
});
This release deprecates the Hub class, as well as the addRequestDataToTransaction method. The trpcMiddleware
method is no longer on the Handlers export, but instead is a standalone export.
Please see the detailed Migration docs on how to migrate to the new APIs.
trpcMiddleware (#11389)Hub class (#11528)Hub interface (#11530)addRequestDataToTransaction (#11368)OPTIONS and HEAD request. (#11485)statsd to metric_bucket (#11505)This release deprecates some exports from the @sentry/replay package. These exports have been moved to the browser SDK
(or related framework SDKs like @sentry/react).
rrweb to 2.12.0 (#11317)@sentry/replay exports (#11242)Work in this release contributed by @soerface. Thank you for your contribution!
This release fixes issues with Time to First Byte (TTFB) calculation in the SDK that was introduced with 7.95.0. It
also fixes some bugs with Interaction to First Paint (INP) instrumentation. This may impact your Sentry Performance
Score calculation.
ResizeObserver and googletag default filters (#11210)cron (#11225)sampled type on Transaction (#11146)Work in this release contributed by @quisido and @joshkel. Thank you for your contributions!
This release fixes issues with INP instrumentation with the Next.js SDK and adds support for the enableInp option in
the deprecated BrowserTracing integration for backwards compatibility.
handled value in ErrorBoundary depending on fallback [v7] (#11037)createReduxEnhancer on server (#11010)tunnelRoute option (#10958)setTransactionNameglobal (#10925)AttachmentType and use for envelope attachment_type property (#10946)Work in this release contributed by @jessezhang91 and @bfontaine. Thank you for your contributions!
withActiveSpan is exported everywhere (#10877)You can use the withActiveSpan method to ensure a certain span is the active span in a given callback. This can be
used to create a span as a child of a specific span with the startSpan API methods:
const parentSpan = Sentry.startInactiveSpan({ name: 'parent' });
if (parentSpan) {
withActiveSpan(parentSpan, () => {
// This will be a direct child of parentSpan
const childSpan = Sentry.startInactiveSpan({ name: 'child' });
});
}
This release adds support for the INP web vital. This is currently only supported for Saas Sentry, and product support
is released with the upcoming 24.3.0 release of self-hosted.
To opt-in to this feature, you can use the enableInp option in the browserTracingIntegration:
Sentry.init({
integrations: [
Sentry.browserTracingIntegration({
enableInp: true,
});
]
})
nodeProfilingIntegration (#10864)errorHandler for replayCanvas integration (#10796)forceTransaction to startSpan() APIs (#10819)You can now pass forceTransaction: true to startSpan(), startSpanManual() and startInactiveSpan(). This allows
you to start a span that you want to be a transaction, if possible. Under the hood, the SDK will connect this span to
the running active span (if there is one), but still send the new span as a transaction to the Sentry backend, if
possible, ensuring it shows up as a transaction throughout the system.
Please note that setting this to true does not guarantee that this will be sent as a transaction, but that the SDK
will try to do so. You can enable this flag if this span is important to you and you want to ensure that you can see it
in the Sentry UI.
window.location (#10659)@remix-run/router a dependency (v7) (#10779)captureContext function (#10737)In version 7.101.0 the @sentry/hub package was missing due to a publishing issue. This release contains the package
again.
webpack:// prefix more broadly from source map sources field (#10641)Hub constructor (#10584)getReplay utility function (#10510)exports field to package.json (#10569)This release contains build fixes for profiling-node.
This release includes some deprecations. For more details please look at our migration guide.
The deprecation most likely to affect you is the one of BrowserTracing. Instead of new BrowserTracing(), you should
now use browserTracingIntegration(), which will also handle framework-specific instrumentation out of the box for
you - no need to pass a custom routingInstrumentation anymore. For @sentry/react, we expose dedicated integrations
for the different react-router versions:
reactRouterV6BrowserTracingIntegration()reactRouterV5BrowserTracingIntegration()reactRouterV4BrowserTracingIntegration()reactRouterV3BrowserTracingIntegration()See the migration guide for details.
browserTracingIntegration() (#10353)BrowserTracing integration (#10493)browserProfilingIntegration (#10438)bunServerIntegration() (#10439)browserTracingIntegration (#10397)reactRouterV3BrowserTracingIntegration for react router v3 (#10489)reactRouterV4/V5BrowserTracingIntegration for react router v4 & v5 (#10488)reactRouterV6BrowserTracingIntegration for react router v6 & v6.4 (#10491)browserTracingIntegration (#10442)WinterCGFetch with winterCGFetchIntegration (#10436)continueTrace (#10301)new VueIntegration() (#10440)browserTracingIntegration() (#10477)browserTracingIntegration() (#10450)@sentry/profiling-node has been ported into the monorepo. Future development for it will happen here!
setHttpStatus from all packages (#10475)Sentry namespace (#10452)name & attributes to tracesSampler (#10426)system-ui to start of font family (#10464)rrweb to 2.10.0 (#10445)propagationContextFromHeaders (#10313)startSpan, startSpanManual and startInactiveSpan pick up the scopes at time of creation instead of
termination (#10492)require call to import Undici (#10388)This release includes some deprecations for span related methods and integrations in our Deno SDK, @sentry/deno. For
more details please look at our
migration guide.
Span.setHttpStatus in favor of setHttpStatus (#10268)spanStatusfromHttpCode in favour of getSpanStatusFromHttpCode (#10361)StartSpanOptions.origin in favour of passing attribute (#10274)@sentry/node re-exports (#10396)afterAllSetup hook for integrations (#10345)startSpan() can handle spans that require parent (#10386)startSpan APIs (#10300)@sentry/node functions (#10385, #10391)@sentry/node re-exports (#10390)@sentry/node re-exports (#10392)browserTracingIntegration (#10351)afterAllSetup is called when using addIntegration() (#10372)spanToTraceContext function from span utils (#10364)FunctionToString integration use SETUP_CLIENTS weakmap (#10358)Work in this release contributed by @AleshaOleg. Thank you for your contribution!
This release primarily fixes some type declaration errors:
IntegrationIndex type (#10337)Note: The 7.96.0 release was incomplete. This release is partially encompassing changes from 7.96.0.
stripBasename option for React Router 6 (#10314)Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.98.0 directly.
This release includes some deprecations for integrations in @sentry/browser and frontend framework SDKs
(@sentry/react, @sentry/vue, etc.). Please take a look at our
migration guide for more details.
This release fixes an issue with the Web Vitals integration where LCP and CLS were not being captured correctly,
increasing capture rate by 10-30% for some apps. LCP and CLS capturing issues were introduced with version 7.75.0.
node-cron types and add test (#10315)Work in this release contributed by @Shubhdeep12. Thank you for your contribution!
This release includes some deprecations in preparation for v8.
Most notably, it deprecates the Replay & Feedback classes in favor of a functional replacement:
import * as Sentry from '@sentry/browser';
Sentry.init({
integrations: [
// Instead of
new Sentry.Replay(),
new Sentry.Feedback(),
// Use the functional replacement:
Sentry.replayIntegration(),
Sentry.feedbackIntegration(),
],
});
Span.origin in favor of sentry.origin attribute (#10260)Span.parentSpanId (#10244)isInitialized() to replace checking via getClient (#10296)Replay, ReplayCanvas, Feedback classes (#10270)Wasm integration class (#10230)parameterize function available through browser and node API (#10085)addOrUpdateIntegration (#10263)Work in this release contributed by @AleshaOleg. Thank you for your contribution!
This release fixes a publishing issue.
As we're moving closer to the next major version of the SDK, more public APIs were deprecated.
To get a head start on migrating to the replacement APIs, please take a look at our migration guide.
finish on Span interface in favour of end (#10161)getCurrentHub() (#10200)hub.bindClient() & makeMain() (#10188)Span.instrumenter (#10139)Span.isSuccess() in favor of reading span status (#10213)Span.op in favor of op attribute (#10189)Span.spanRecorder (#10199)Span.status (#10208)Span.transaction in favor of getRootSpan (#10134)Transaction.instrumenter (#10162)Transaction.setMeasurement in favor of setMeasurement (#10182)Integrations.X (#10198)Hub (#10124)setName declarations on Transaction and Span (#10164)startTimestamp & endTimestamp (#10192)hub.bindClient() and makeMain() (#10118)op on Span interface (#10217)Transaction integration (#10178)We have added a new ReplayCanvas integration (#10112), which you can add to capture the contents of canvas elements
with Replay.
Just add it in addition to the regular replay integration:
Sentry.init({
integrations: [new Sentry.Replay(), new Sentry.ReplayCanvas()],
});
client.getIntegrationByName() (#10130)client.init() to replace client.setupIntegrations() (#10118)withActiveSpan (#10195)withIsolationScope (#10141)setUser, setTags, setExtras, setTag, setExtra, and setContext to isolation
scope (#10163)withActiveSpan (#10194)SerializedEvent interface (pre v8) (#10240)http.status_code is always a string (#10177)process.argv[1] being undefined (#10155)fetch init headers over fetch input headers (#10176)As we're moving closer to the next major version of the SDK, more public APIs were deprecated.
To get a head start on migrating to the replacement APIs, please take a look at our migration guide.
getActiveTransaction() & scope.getTransaction() (#10098)Hub.shouldSendDefaultPii (#10062)new Transaction() (#10125)scope.getSpan() & scope.setSpan() (#10114)scope.setTransactionName() (#10113)span.startChild() (#10091)startTransaction() (#10073)Transaction.getDynamicSamplingContext in favor of getDynamicSamplingContextFromSpan (#10094)startSpan() (#10101)Scope (#10039)name and description (#10056)tags, data, context & setters (#10053)span.sampled in favor of span.isRecording() (#10034)lastEventId on scope (#10093)node-schedule libraryThis release adds auto instrumented check-ins for the node-schedule library.
import * as Sentry from '@sentry/node';
import * as schedule from 'node-schedule';
const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);
const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {
console.log('You will see this message every minute');
});
node-schedule library (#10086)span.spanContext() (#10037)spanToJSON() method to get span properties (#10074)scope to startSpan APIs (#10076)getModuleFromFilename compatible with ESM (#10061)parameterize function (#9145)setup for integration on client multiple times (#10116)LocalVariables integration should have correct name (#10084)event_id (#10068)LocalVariables (#10077)span.updateName() and deprecate span.setName() (#10018)span.getTraceContext() (#10032)span.toTraceparent() in favor of spanToTraceHeader() util (#10031)trace in favor of startSpan (#10012)toContext() and updateWithContext() (#10030)deepReadDirSync (#10016)lastEventId() (#10043)Please take a look at the Migration docs for more details. These methods will be removed in the upcoming v8 major release.
cron and node-cron librariescron library (#9999)node-cron library (#9904)This release adds instrumentation for the cron and node-cron libraries. This allows you to monitor your cron jobs
with Sentry cron monitors.
For cron:
import * as Sentry from '@sentry/node';
import { CronJob } from 'cron';
const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job');
// use the constructor
const job = new CronJobWithCheckIn('* * * * *', () => {
console.log('You will see this message every minute');
});
// or from
const job = CronJobWithCheckIn.from({
cronTime: '* * * * *',
onTick: () => {
console.log('You will see this message every minute');
},
});
For node-cron:
import * as Sentry from '@sentry/node';
import cron from 'node-cron';
const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);
cronWithCheckIn.schedule(
'* * * * *',
() => {
console.log('running a task every minute');
},
{ name: 'my-cron-job' },
);
enabled option to Astro integration options (#10007)attributes to Span (#10008)setClient() and getClient() to Scope (#10055)captureErrorCause in ExtraErrorData integration (#9914)withScope sets current scope correctly with async callbacks (#9974)NODE_VERSION properties required (#9964)Work in this release contributed by @joshkel. Thank you for your contribution!
The release adds alpha support for Sentry developer metrics in
the server runtime SDKs (@sentry/node, @sentry/deno, @sentry/nextjs server-side, etc.). Via the newly introduced
APIs, you can now flush metrics directly to Sentry.
To enable capturing metrics, you first need to add the metricsAggregator experiment to your Sentry.init call.
Sentry.init({
dsn: '__DSN__',
_experiments: {
metricsAggregator: true,
},
});
Then you'll be able to add counters, sets, distributions, and gauges under the Sentry.metrics namespace.
// Add 4 to a counter named `hits`
Sentry.metrics.increment('hits', 4);
// Add 2 to gauge named `parallel_requests`, tagged with `type: "a"`
Sentry.metrics.gauge('parallel_requests', 2, { tags: { type: 'a' } });
// Add 4.6 to a distribution named `response_time` with unit seconds
Sentry.metrics.distribution('response_time', 4.6, { unit: 'seconds' });
// Add 2 to a set named `valuable.ids`
Sentry.metrics.set('valuable.ids', 2);
The ANR tracking integration for Node
has been reworked to use an integration. ANR tracking now requires a minimum Node version of 16 or higher. Previously
you had to call Sentry.enableANRDetection before running your application, now you can simply add the Anr
integration to your Sentry.init call.
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Sentry.Integrations.Anr({ captureStackTrace: true, anrThreshold: 200 })],
});
getGlobalScope() method (#9920)getIsolationScope() method (#9957)span.end() to replace span.finish() (#9954)startSpan & startSpanManual fork scope (#9955)startSpan, startSpanManual, trace (#9958)types field to package.json exports (#9926)configureScope (#9887)pushScope & popScope (#9890)This release deprecates configureScope, pushScope, and popScope, which will be removed in the upcoming v8 major
release.
This release adds an integration for Hapi. It can be used as follows:
const Sentry = require('@sentry/node');
const Hapi = require('@hapi/hapi');
const init = async () => {
const server = Hapi.server({
// your server configuration ...
});
Sentry.init({
dsn: '__DSN__',
tracesSampleRate: 1.0,
integrations: [new Sentry.Integrations.Hapi({ server })],
});
server.route({
// your route configuration ...
});
await server.start();
};
This release adds support for SvelteKit 2.0 in the @sentry/sveltekit package. If you're upgrading from SvelteKit 1.x
to 2.x and already use the Sentry SvelteKit SDK, no changes apart from upgrading to this (or a newer) version are
necessary.
withScope to return callback return value (#9866)Deno.CronSchedule for cron jobs (#9880)canvas.type setting (#9877)createReduxEnhancer (#9854)Event type in worldwide (#9864)eventFromUnknownInput to avoid scope pollution & getCurrentHub (#9868)addBreadcrumb directly & allow to pass hint (#9867)Work in this release contributed by @adam187, and @jghinestrosa. Thank you for your contributions!
The release adds alpha support for Sentry developer metrics in
the Browser SDKs (@sentry/browser and related framework SDKs). Via the newly introduced APIs, you can now flush
metrics directly to Sentry.
To enable capturing metrics, you first need to add the MetricsAggregator integration.
Sentry.init({
dsn: '__DSN__',
integrations: [new Sentry.metrics.MetricsAggregator()],
});
Then you'll be able to add counters, sets, distributions, and gauges under the Sentry.metrics namespace.
// Add 4 to a counter named `hits`
Sentry.metrics.increment('hits', 4);
// Add 2 to gauge named `parallel_requests`, tagged with `happy: "no"`
Sentry.metrics.gauge('parallel_requests', 2, { tags: { happy: 'no' } });
// Add 4.6 to a distribution named `response_time` with unit seconds
Sentry.metrics.distribution('response_time', 4.6, { unit: 'seconds' });
// Add 2 to a set named `valuable.ids`
Sentry.metrics.set('valuable.ids', 2);
In a future release we'll add support for server runtimes (Node, Deno, Bun, Vercel Edge, etc.)
Deno.cron (#9808)This releases add support for instrumenting Deno cron's with
Sentry cron monitors. This requires v1.38 of Deno run with the --unstable
flag and the usage of the DenoCron Sentry integration.
// Import from the Deno registry
import * as Sentry from 'https://deno.land/x/sentry/index.mjs';
Sentry.init({
dsn: '__DSN__',
integrations: [new Sentry.DenoCron()],
});
rrweb to 2.6.0 (#9847)getCurrentScope() method (#9800)rrweb to 2.5.0 (#9803)./exports (#9775)assetPrefix is defined (#9766)process.env.NODE_ENV access in Spotlight integration (#9748)addEventProcessor method (#9554)box-shadow to use CSS var (#9630)automaticVercelMonitors to be false by default (#9697)From this version onwards the default for the automaticVercelMonitors option in the Next.js SDK is set to false.
Previously, if you made use of Vercel Crons the SDK automatically instrumented the relevant routes to create Sentry
monitors. Because this feature will soon be generally available, we are now flipping the default to avoid situations
where quota is used unexpectedly.
If you want to continue using this feature, make sure to set the automaticVercelMonitors flag to true in your
next.config.js Sentry settings.
astro peer dependency range (#9696)middleware in node_modules (#9686)assets option to source maps upload options (#9668)exactOptionalPropertyTypes on ErrorBoundary (#9098)types (#9682)setup hook to integrations (#9556)getClient() method (#9638)mechanism as event hint (#9590)continueTrace without callback (#9615)addInstrumentationHandler to dedicated methods (#9542)BODY_PARSE_ERROR warning & time out fetch response load (#9622)RequestData integration to @sentry/core (#9597)Work in this release contributed by @arya-s. Thank you for your contribution!
globalThis instead of global in edge runtime (#9612)Work in this release contributed by @powerfulyang, @LubomirIgonda1, @joshkel, and @alexgleason. Thank you for your contributions!
- feat(nextjs): Add instrumentation utility for server actions (#9553)
This release adds a utility function withServerActionInstrumentation to the @sentry/nextjs SDK for instrumenting
your Next.js server actions with error and performance monitoring.
You can optionally pass form data and headers to record them, and configure the wrapper to record the Server Action responses:
import * as Sentry from '@sentry/nextjs';
import { headers } from 'next/headers';
export default function ServerComponent() {
async function myServerAction(formData: FormData) {
'use server';
return await Sentry.withServerActionInstrumentation(
'myServerAction', // The name you want to associate this Server Action with in Sentry
{
formData, // Optionally pass in the form data
headers: headers(), // Optionally pass in headers
recordResponse: true, // Optionally record the server action response
},
async () => {
// ... Your Server Action code
return { name: 'John Doe' };
},
);
}
return (
<form action={myServerAction}>
<input type="text" name="some-input-value" />
<button type="submit">Run Action</button>
</form>
);
}
sendFeedback (#9560)level and remove breadcrumbs from feedback event (#9533)extractTraceParentData from @sentry/core & downstream packages (#9158)Work in this release contributed by @snoozbuster. Thank you for your contribution!
db.prisma (#9512)<meta> tags (#9483)MetaFunction parameters (#9493)origin to trace context (#9472)We've dramatically decreased the bundle size of our Replay package, reducing the minified & gzipped bundle size by ~20 KB! This was possible by extensive use of tree shaking and a host of small changes to reduce our footprint:
By using tree shaking it is possible to shave up to 10 additional KB off the bundle.
openDialog and closeDialog onto integration interface (#9464)beforeErrorSampling (#9470)This release adds Sentry.withMonitor(), a wrapping function that wraps a callback with a cron monitor that will
automatically report completions and failures:
import * as Sentry from '@sentry/node';
// withMonitor() will send checkin when callback is started/finished
// works with async and sync callbacks.
const result = Sentry.withMonitor(
'dailyEmail',
() => {
// withCheckIn return value is same return value here
return sendEmail();
},
// Optional upsert options
{
schedule: {
type: 'crontab',
value: '0 * * * *',
},
// 🇨🇦🫡
timezone: 'Canada/Eastern',
},
);
jsx and tsx file extensions (#9362)replay_id is not added to DSC if session expired (#9359)Work in this release contributed by @LubomirIgonda1. Thank you for your contribution!
@sentry/opentelemetry package (#9238)This release publishes a new package, @sentry/opentelemetry. This is a runtime agnostic replacement for
@sentry/opentelemetry-node and exports a couple of useful utilities which can be used to use Sentry together with
OpenTelemetry.
You can read more about @sentry/opentelemetry in the Readme.
Starting with this release, you can configure the following build-time flags in order to reduce the SDK bundle size:
__RRWEB_EXCLUDE_CANVAS____RRWEB_EXCLUDE_IFRAME____RRWEB_EXCLUDE_SHADOW_DOM__You can read more about tree shaking in our docs.
lru_map dependency (#9300)cookie module (#9308)Replay and BrowserTracing integrations tree-shakeable (#9287)autoInstrumentMiddleware functionality (#9323)getInitialProps may return undefined (#9342)astro-integration keyword (#9265)fetch (#9275)defer injection logic. (#9242)Work in this release contributed by @LubomirIgonda1. Thank you for your contribution!
sentryAstro integration (#9218)This Release introduces the first alpha version of our new SDK for Astro. At this time, the SDK is considered experimental and things might break and change in future versions.
The core of the SDK is an Astro integration which you easily add to your Astro config:
// astro.config.js
import { defineConfig } from 'astro/config';
import sentry from '@sentry/astro';
export default defineConfig({
integrations: [
sentry({
dsn: '__DSN__',
sourceMapsUploadOptions: {
project: 'astro',
authToken: process.env.SENTRY_AUTH_TOKEN,
},
}),
],
});
Check out the README for usage instructions and what to expect from this alpha release.
addIntegration utility (#9186)continueTrace method (#9164)VueIntegration to initialize vue app later (#9180)referrerPolicy on serverside fetch transports (#9200)init (#9162)inspector when needed (#9149)debug option and instead add logger.isEnabled() (#9230).mjs and .cjs extensions from module name (#9231)processEvent integration hook (#9151)processEvent (#9021)rethrowAfterCapture option (#9159)walk method (#9157)Work in this release contributed by @aldenquimby. Thank you for your contributions!
This is fully backwards compatible with prior versions of the Replay SDK. The only breaking change that we will making
is to not be masking aria-label by default. The reason for this change is to align with our core SDK which also does
not mask aria-label. This change also enables better support of searching by clicks.
Another change that needs to be highlighted is the 13% bundle size increase. This bundle size increase is necessary to bring improved recording performance and improved replay fidelity, especially in regards to web components and iframes. We will be investigating the reduction of the bundle size in this PR.
Here are benchmarks comparing the version 1 of rrweb to version 2
| metric | v1 | v2 |
|---|---|---|
| lcp | 1486.06 ms | 1529.11 ms |
| cls | 0.40 ms | 0.40 ms |
| fid | 1.53 ms | 1.50 ms |
| tbt | 3207.22 ms | 3036.80 ms |
| memoryAvg | 131.83 MB | 124.84 MB |
| memoryMax | 324.8 MB | 339.03 MB |
| netTx | 282.67 KB | 272.51 KB |
| netRx | 8.02 MB | 8.07 MB |
captureAllExceptions by default (#9102)tunnel is considered for isSentryUrl checks (#9130)RequestAsyncStorage fallback path (#9126)load functions (#9071)InboundFilters integration to use processEvent (#9020)processEvent (#9019)Work in this release contributed by @vlad-zhukov. Thank you for your contribution!
This release introduces support for Application Not Responding (ANR) errors for Node.js applications. These errors are triggered when the Node.js main thread event loop of an application is blocked for more than five seconds. The Node SDK reports ANR errors as Sentry events and can optionally attach a stacktrace of the blocking code to the ANR event.
To enable ANR detection, import and use the enableANRDetection function from the @sentry/node package before you run
the rest of your application code. Any event loop blocking before calling enableANRDetection will not be detected by
the SDK.
Example (ESM):
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: '___PUBLIC_DSN___',
tracesSampleRate: 1.0,
});
await Sentry.enableANRDetection({ captureStackTrace: true });
// Function that runs your app
runApp();
Example (CJS):
const Sentry = require('@sentry/node');
Sentry.init({
dsn: '___PUBLIC_DSN___',
tracesSampleRate: 1.0,
});
Sentry.enableANRDetection({ captureStackTrace: true }).then(() => {
// Function that runs your app
runApp();
});
RequestAsyncStorage locations by locations that webpack will resolve (#9114)replay_id is not captured when session is expired (#9109)basename-prefixed route. (#9076)processEvent (#9022)Work in this release contributed by @jorrit. Thank you for your contribution!
This release contains the beta version of @sentry/bun, our SDK for the Bun JavaScript runtime! For
details on how to use it, please see the README. Any feedback/bug reports are greatly
appreciated, please reach out on GitHub.
Note that as of now the Bun runtime does not support global error handlers. This is being actively worked on, see the tracking issue in Bun's GitHub repo.
The Sentry Remix SDK now officially supports Remix v2! See our Remix docs for more details.
processEvent hook on Integration (#9017)React.ComponentType instead of React.FC as withSentry's generic type. (#9043)preprocessEvent hook (#9034)handleErrorWithSentry type (#9054)Work in this release contributed by @Dima-Dim, @krist7599555 and @lifeiscontent. Thank you for your contributions!
Special thanks for @isaacharrisholt for helping us implement a Vercel Edge Runtime SDK which we use under the hood for our Next.js SDK.
This release introduces a new set of top level APIs for the Performance Monitoring SDKs. These aim to simplify creating
spans and reduce the boilerplate needed for performance instrumentation. The three new methods introduced are
Sentry.startSpan, Sentry.startInactiveSpan, and Sentry.startSpanManual. These methods are available in the browser
and node SDKs.
Sentry.startSpan wraps a callback in a span. The span is automatically finished when the callback returns. This is the
recommended way to create spans.
// Start a span that tracks the duration of expensiveFunction
const result = Sentry.startSpan({ name: 'important function' }, () => {
return expensiveFunction();
});
// You can also mutate the span wrapping the callback to set data or status
Sentry.startSpan({ name: 'important function' }, span => {
// span is undefined if performance monitoring is turned off or if
// the span was not sampled. This is done to reduce overhead.
span?.setData('version', '1.0.0');
return expensiveFunction();
});
If you don't want the span to finish when the callback returns, use Sentry.startSpanManual to control when the span is
finished. This is useful for event emitters or similar.
// Start a span that tracks the duration of middleware
function middleware(_req, res, next) {
return Sentry.startSpanManual({ name: 'middleware' }, (span, finish) => {
res.once('finish', () => {
setHttpStatus(span, res.status);
finish();
});
return next();
});
}
Sentry.startSpan and Sentry.startSpanManual create a span and make it active for the duration of the callback. Any
spans created while this active span is running will be added as a child span to it. If you want to create a span
without making it active, use Sentry.startInactiveSpan. This is useful for creating parallel spans that are not
related to each other.
const span1 = Sentry.startInactiveSpan({ name: 'span1' });
someWork();
const span2 = Sentry.startInactiveSpan({ name: 'span2' });
moreWork();
const span3 = Sentry.startInactiveSpan({ name: 'span3' });
evenMoreWork();
span1?.finish();
span2?.finish();
span3?.finish();
BeforeFinishCallback type (#8999)LinkedErrors integration runs before all event processors (#8956)org, project and url as args to upload script (#8985)ignoreErrors (#8986)pg spans (#8993)useRoutes (#8998)glob to Remix SDK dependencies. (#8963)handleRecordingEmit aborts when event is not added (#8938)Work in this release contributed by @Duncanxyz and @malay44. Thank you for your contributions!
BroadcastChannel and SharedWorker to TryCatch EventTargets (#8943)name to Span (#8949)ServerRuntimeClient (#8930)span.finish() works as expected (#8947)TryCatch integration as unhandled (#8890)HttpClient and CaptureConsole integrations as unhandled (#8891)This release fixes inconsistent behaviour of when our SDKs classify captured errors as unhandled. Previously, some of
our instrumentations correctly set unhandled, while others set handled. Going forward, all errors caught automatically
from our SDKs will be marked as unhandled. If you manually capture errors (e.g. by calling Sentry.captureException),
your errors will continue to be reported as handled.
This change might lead to a decrease in reported crash-free sessions and consequently in your release health score. If you have concerns about this, feel free to open an issue.
maxReplayDuration (#8769)BrowserClientOptions (#8921)wrap function (#8927)Work in this release contributed by @SorsOps. Thank you for your contribution!
package.json exports (#8895)origin to spans (#8765)@sentry/vite-plugin (#8877)Sentry.startActiveSpan and Sentry.startSpan (#8803)AsyncLocalStorage instance (#8831)requestAsyncStorageShim path resolution on windows (#8875)OnUncaughtException (#8876)wrapServerLoadWithSentry (#8801)tracePropagationTargets in BrowserTracing (#8874)exceptionFromError for use in hybrid SDKs (#8766)autoInstrumentServerFunctions and autoInstrumentAppDirectory
(#8781)hasCheckout handling (#8782)ContextLines integration for html-embedded JS stack frames (#8699)This release adds the ContextLines integration as an optional integration for the Browser SDKs to
@sentry/integrations.
This integration adds source code from inline JavaScript of the current page's HTML (e.g. JS in <script> tags) to
stack traces of captured errors. It can't collect source code from assets referenced by your HTML (e.g.
<script src="..." />).
The ContextLines integration is useful when you have inline JS code in HTML pages that can't be accessed by Sentry's
backend, for example, due to a login-protected page.
import { ContextLines } from '@sentry/integrations';
Sentry.init({
// ...
integrations: [
new ContextLines({
// The number of lines to collect before and after each stack frame's line number
// Defaults to 7
frameContextLines: 7,
}),
],
});
dirname and basename should handle Windows paths (#8737)flush, close, and lastEventId into @sentry/core (#8731)JSON.stringify on prisma client when logging (#8745)AsyncLocalStorage async context strategy to edge SDK (#8720)ContextLines integration (#8715)pre_context and context_line overlap if frame lineno is out of bounds (#8722)@sentry/node-experimental package as MVP for POTEL (#8609)This introduces a new, experimental package, @sentry/node-experimental. This is a variant of the Node SDK which uses
OpenTelemetry under the hood for performance instrumentation.
Note that this package is very much WIP, considered unstable and may change at any time. No SemVer guarantees apply whatsoever. Still, if you're brave enough you can give it a try. Read more about @sentry/node-experimental
shift pressed (#8648)session.started for min/max duration check (#8617)We will not send replays that are <5s long anymore. Additionally, we also added further safeguards to avoid overly long (>1h) replays. You can optionally configure the min. replay duration (defaults to 5s):
new Replay({
minReplayDuration: 10000, // in ms - note that this is capped at 15s max!
});
No changes. This release was published to fix publishing issues with 7.59.0 and 7.59.1. Please see 7.59.0 for the changes in that release.
No changes. This release was published to fix a publishing issue with 7.59.0. Please see 7.59.0 for the changes in that release.
This release adds support for Remix v2 future flags, in particular for new error handling utilities of Remix v2. We
heavily recommend you switch to using v2_errorBoundary future flag to get the best error handling experience with
Sentry.
To capture errors from v2 client-side ErrorBoundary, you
should define your own ErrorBoundary in root.tsx and use Sentry.captureRemixErrorBoundaryError helper to capture
the error.
// root.tsx
import { captureRemixErrorBoundaryError } from "@sentry/remix";
export const ErrorBoundary: V2_ErrorBoundaryComponent = () => {
const error = useRouteError();
captureRemixErrorBoundaryError(error);
return <div> ... </div>;
};
For server-side errors, define a
handleError function in your server entry
point and use the Sentry.captureRemixServerException helper to capture the error.
// entry.server.tsx
export function handleError(error: unknown, { request }: DataFunctionArgs): void {
if (error instanceof Error) {
Sentry.captureRemixServerException(error, 'remix.server', request);
} else {
// Optionally capture non-Error objects
Sentry.captureException(error);
}
}
For more details, see the Sentry Remix SDK documentation.
ModuleMetadata integration (#8475)SentryWebpackPlugin in dev mode (#8557)HTTP_URL attribute for client requests (#8539)beforeAddRecordingEvent callback (#8548)This release adds support for
distributed tracing without requiring
performance monitoring to be active on the JavaScript SDKs (browser and node). This means even if there is no sampled
transaction/span, the SDK will still propagate traces to downstream services. Distributed Tracing can be configured with
the tracePropagationTargets option, which controls what requests to attach the sentry-trace and baggage HTTP
headers to (which is what propagates tracing information).
Sentry.init({
tracePropagationTargets: ['third-party-site.com', /^https:\/\/yourserver\.io\/api/],
});
feat(tracing): Add tracing without performance to browser and client Sveltekit (#8458)
feat(node): Add tracing without performance to Node http integration (#8450)
feat(node): Add tracing without performance to Node Undici (#8449)
feat(node): Populate propagation context using env variables (#8422)
feat(core): Support AggregateErrors in LinkedErrors integration (#8463)
This release adds support for
AggregateErrors.
AggregateErrors are considered as Exception Groups by Sentry, and will be visualized and grouped differently. See the
Exception Groups Changelog Post
for more details.
Exception Group support requires Self-Hosted Sentry version 23.5.1 or newer.
networkDetailDenyUrls (#8439)This release adds a new option networkDetailDenyUrls to the Replay integration. This option allows you to specify a
list of URLs that should not be captured by the Replay integration, which can be used alongside the existing
networkDetailAllowUrls for finely grained control of which URLs should have network details captured.
Sentry.init({
integrations: [
new Sentry.Integrations.Replay({
networkDetailDenyUrls: [/^http:\/\/example.com\/test$/],
}),
],
});
getModule for Electron SDK (#8488)user.id to be a number (#8330)crossorigin attribute on report dialog (#8424)tunnelRoute when doing static exports (#8471)basePath option for tunnelRoute (#8454)basename option of createBrowserRouter (#8457)@sentry/node exports. (#8509)redirect and catch responses (#8467)Work in this release contributed by @mrdulin, @donaldxdonald & @ziyad-elabid-nw. Thank you for your contributions!
This release version bumps the internally used typescript version from 3.8.x to 4.9.x. We use ds-downlevel to generate two versions of our types, one for >=3.8, one for >=4.9. This means that this change should be fully backwards compatible and not have any noticable user impact, but if you still encounter issues please let us know.
Instead of passing tracePropagationTargets to the BrowserTracing integration, you can now define them on the top
level:
Sentry.init({
tracePropagationTargets: ['api.site.com'],
});
TryCatch integration by default (#8367)The Angular and Angular-ivy SDKs will not install the TryCatch integration anymore by default. This integration
conflicted with the SentryErrorHander, sometimes leading to duplicated errors and/or missing data on events.
When capturing non-errors via Sentry.captureException(), e.g. Sentry.captureException({ prop: "custom object" }), we
now generate a more helpful value for the synthetic exception. Instead of e.g.
Non-Error exception captured with keys: currentTarget, isTrusted, target, type, you'll now get messages like:
Object captured as exception with keys: prop1, prop2
Event `MouseEvent` (type=click) captured as exception
Event `ErrorEvent` captured as exception with message `Script error.`
http.response.status_code to span.data (#8366)trace if tracing is enabled (#8357)clickCount as optional (#8376)autoDiscoverNodePerformanceMonitoringIntegrations from SDK (#8382)fetch if the SDK client is valid (#8381)sessionStorage check (#8394)window.open for slow clicks (#8308)debug_meta before sending (#8347)next in Vue router 4 instrumentation (#8351)EventType from @sentry-internal/rrweb (#8334)@sentry-internal/rrweb (#8329)feat(core): Add default entries to ignoreTransactions for Healthchecks #8191
All SDKs now filter out health check transactions by default. These are transactions where the transaction name
matches typical API health check calls, such as /^.*healthy.*$/ or /^. *heartbeat.*$/. Take a look at
this list
to learn which regexes we currently use to match transaction names. We believe that these transactions do not provide
value in most cases and we want to save you some of your quota by filtering them out by default. These filters are
implemented as default values for the top level ignoreTransactions option.
You can disable this filtering by manually specifiying the InboundFilters integration and setting the
disableTransactionDefaults option:
Sentry.init({
//...
integrations: [new InboundFilters({ disableTransactionDefaults: true })],
});
feat(replay): Add mutationBreadcrumbLimit and mutationLimit to Replay Options (#8228)
The previously experimental options mutationBreadcumbLimit and mutationLimit have been promoted to regular Replay
integration options.
A high number of DOM mutations (in a single event loop) can cause performance regressions in end-users' browsers. Use
mutationBreadcrumbLimit to send a breadcrumb along with your recording if the mutation limit was reached. Use
mutationLimit to stop recording if the mutation limit was reached.
feat(sveltekit): Add source maps support for Vercel (lambda) (#8256)
The SvelteKit SDK can now be used if you deploy your SvelteKit app to Vercel. By default, the SDK's Vite plugin will
detect the used adapter and adjust the source map uploading config as necessary. If you want to override the default
adapter detection, you can specify the adapter option in the sentrySvelteKit options:
// vite.config.js
export default defineConfig({
plugins: [
sentrySvelteKit({
adapter: 'vercel',
}),
sveltekit(),
],
});
Currently, the Vite plugin will configure itself correctly for @sveltejs/adapter-auto, @sveltejs/adapter-vercel
and @sveltejs/adapter-node.
Important: The SvelteKit SDK is not yet compatible with Vercel's edge runtime. It will only work for lambda functions.
loadContext through wrapped document request function (#8268)magicast to support satisfied keyword (#8254)os.uptime() throwing because of EPERM (#8206)beforeAddRecordingEvent Replay option (#8124)withSentryConfig isomorphic (#8166)maskFnThis release adds support Vercel Cron Jobs in the Next.js SDK. The SDK will automatically create
Sentry Cron Monitors for your
Vercel Cron Jobs configured via vercel.json when deployed on Vercel.
You can opt out of this functionality by setting the automaticVercelMonitors option to false:
// next.config.js
const nextConfig = {
sentry: {
automaticVercelMonitors: false,
},
};
(Note: Sentry Cron Monitoring is currently in beta and subject to change. Help us make it better by letting us know what you think. Respond on GitHub or write to us at [email protected])
ignoreErrors check (#8089)addTracingExtensions was not documented in MIGRATION.md (#8101)createCheckinEnvelope to core package (#8082)load when typed explicitly (#8049)Replay rrweb changes:
@sentry-internal/rrweb was updated from 1.106.0 to 1.108.0:
: in CSS rule from Safari (#86)Work in this release contributed by @sreetamdas. Thank you for your contribution!
load functions with proxy module (#7994)@sentry/sveltekit now auto-wraps load functions in
+(page|layout).(ts|js) files (universal loads)+(page|layout).server.(ts|js) files (server-only loads)This means that you don't have to manually add the wrapLoadWithSentry and wrapServerLoadWithSentry functions around
your load functions. The SDK will not interfere with already wrapped load functions.
For more details, take a look at the Readme
peerDependencies to Angular 16 (#8035)We now officially support Angular 16 in @sentry/angular-ivy. Note that @sentry/angular does not support
Angular 16.
Note: This release contains a bug with generating cron monitors. We recommend you upgrade the JS SDK to 7.51.1 or above to use cron monitoring functionality
This release adds Sentry cron monitoring support to the Node SDK.
Check-in monitoring allows you to track a job's progress by completing two check-ins: one at the start of your job and another at the end of your job. This two-step process allows Sentry to notify you if your job didn't start when expected (missed) or if it exceeded its maximum runtime (failed).
const Sentry = require('@sentry/node');
// 🟡 Notify Sentry your job is running:
const checkInId = Sentry.captureCheckIn({
monitorSlug: '<monitor-slug>',
status: 'in_progress',
});
// Execute your scheduled task here...
// 🟢 Notify Sentry your job has completed successfully:
Sentry.captureCheckIn({
// make sure you pass in the checkInId generated by the first call to captureCheckIn
checkInId,
monitorSlug: '<monitor-slug>',
status: 'ok',
});
If your job execution fails, you can notify Sentry about the failure:
// 🔴 Notify Sentry your job has failed:
Sentry.captureCheckIn({
checkInId,
monitorSlug: '<monitor-slug>',
status: 'error',
});
http.method to node http spans (#7991)RewriteFrames (#7995)Integration type declaration as union type (#8016)undefined to undefined instead of "[undefined]" (#8017)Work in this release contributed by @srubin and @arjenbrandenburgh. Thank you for your contributions!
sentryHandle to a factory function (#7975)With this release, the Sveltekit SDK (@sentry/sveltekit) is promoted to Beta. This means that we do not expect any more breaking changes.
The final breaking change is that sentryHandle is now a function. So in order to update to 7.50.0, you have to update
your hooks.server.js file:
// hooks.server.js
// Old:
export const handle = sentryHandle;
// New:
export const handle = sentryHandle();
You can now capture request/response bodies & headers of network requests in Replay. You have to define an allowlist of URLs you want to capture additional information for:
new Replay({
networkDetailAllowUrls: ['https://sentry.io/api'],
});
By default, we will capture request/response bodies, as well as the request/response headers content-type,
content-length and accept. You can configure this with some additional configuration:
new Replay({
networkDetailAllowUrls: ['https://sentry.io/api'],
// opt-out of capturing bodies
networkCaptureBodies: false,
// These headers are captured _in addition to_ the default headers
networkRequestHeaders: ['X-Custom-Header'],
networkResponseHeaders: ['X-Custom-Header', 'X-Custom-Header-2'],
});
Note that bodies will be truncated to a max length of ~150k characters.
- feat(replay): Changes of sampling behavior & public API
flush() API to record current event buffer (#7743)stop() to flush and remove current session (#7741)We have changed the behavior of error-based sampling, as well as adding & adjusting APIs a bit to be more aligned with expectations. See Sampling for details.
We've also revamped some public APIs in order to be better aligned with expectations. See Stoping & Starting Replays manually for details.
We added a new transport to support multiplexing. With this, you can configure Sentry to send events to different DSNs, depending on a logic of your choosing:
import { makeMultiplexedTransport } from '@sentry/core';
import { init, captureException, makeFetchTransport } from '@sentry/browser';
function dsnFromFeature({ getEvent }) {
const event = getEvent();
switch (event?.tags?.feature) {
case 'cart':
return ['__CART_DSN__'];
case 'gallery':
return ['__GALLERY_DSN__'];
}
return [];
}
init({
dsn: '__FALLBACK_DSN__',
transport: makeMultiplexedTransport(makeFetchTransport, dsnFromFeature),
});
disableLogger option that automatically tree shakes logger statements (#7908)db.system span data to DB spans (#7952)Work in this release contributed by @Jack-Works. Thank you for your contribution!
svelte.config.js (#7863)Our source maps upload plugin is now able to read svelte.config.js. This is necessary to automatically find the output
directory that users can specify when setting up the Node adapter.
This release fixes a potential problem with how Replay captures console logs. Any objects logged will now be cut off after a maximum depth of 10, as well as cutting off any properties after the 1000th. This should ensure we do not accidentally capture massive console logs, where a stringified object could reach 100MB or more.
We used to normalize references to HTML elements as POJOs. This is both not very easily understandable, as well as
potentially large, as HTML elements may have properties attached to them. With this change, we now normalize them to
e.g. [HTMLElement: HTMLInputElement].
import for gatsby-browser.js instead of require (#7889)handleError wrapper (#7898)sentry.properties file when uploading source maps (#7890)timestampWithMs (#7878)AsyncLocalStorage implementation of AsyncContextStrategy (#7800)
AsyncContextStrategy to allow reuse of existing context (#7778)runWithAsyncContext public API (#7817)domain implementation of AsyncContextStrategy (#7767)AsyncContextStrategy for Node.js version (#7804)AsyncContextStrategy (#7779)This release switches the SDK to use
AsyncLocalStorage as the async context isolation
mechanism in the SDK for Node 14+. For Node 10 - 13, we continue to use the Node
domain standard library, since AsyncLocalStorage is not supported there.
Preliminary testing showed
a 30% improvement in latency and rps
when making the switch from domains to AsyncLocalStorage on Node 16.
If you want to manually add async context isolation to your application, you can use the new runWithAsyncContext API.
import * as Sentry from '@sentry/node';
const requestHandler = (ctx, next) => {
return new Promise((resolve, reject) => {
Sentry.runWithAsyncContext(async () => {
const hub = Sentry.getCurrentHub();
hub.configureScope(scope =>
scope.addEventProcessor(event =>
Sentry.addRequestDataToEvent(event, ctx.request, {
include: {
user: false,
},
}),
),
);
try {
await next();
} catch (err) {
reject(err);
}
resolve();
});
});
};
If you're manually using domains to isolate Sentry data, we strongly recommend switching to this API!
In addition to exporting runWithAsyncContext publicly, the SDK also uses it internally where we previously used
domains.
withSentryViteConfig (#7789)
This release removes our withSentryViteConfig wrapper we previously instructed you to add to your vite.config.js
file. It is replaced Vite plugins which you simply add to your Vite config, just like the sveltekit() Vite plugins. We
believe this is a more transparent and Vite/SvelteKit-native way of applying build time modifications. Here's how to use
the plugins:
// vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
import { sentrySvelteKit } from '@sentry/sveltekit';
export default {
plugins: [sentrySvelteKit(), sveltekit()],
// ... rest of your Vite config
};
Take a look at the README
for updated instructions!
Furthermore, with this transition, we removed the possibility to intialize the SDK in dedicated
sentry.(client|server).config.js files. Please use SvelteKit's
hooks files
to initialize the SDK.
Please note that these are breaking changes! We're sorry for the inconvenience but the SvelteKit SDK is still in alpha stage and we want to establish a clean and SvelteKit-friendly API before making the SDK stable. You have been warned ;)
This release adds automatic upload of source maps to the SvelteKit SDK. No need to configure anything other than adding our Vite plugins to your SDK. The example above shows you how to do this.
Please make sure to follow the
README
to specify your Sentry auth token, as well as org and project slugs.
- feat(replay): Capture request & response headers (#7816)
Replay now captures the content-length, content-type, and accept headers from requests and responses
automatically.
getReplayId() method (#7822)BrowserTransportOptions to support offline transport options (#7775)applyDebugMetadata for error events (#7824)reuseExisting does not need to call bind on domain (#7780)trpcMiddleware factory synchronous (#7802)This release adds a new API, Sentry.captureUserFeedback, to browser-side SDKs that allows you to send user feedback to
Sentry without loading and opening Sentry's user feedback dialog. This allows you to obtain user feedback however and
whenever you want to and simply send it to Sentry using the SDK.
For instance, you can collect feedback, whenever convenient as shown in this example:
const eventId = Sentry.captureMessage('User Feedback');
const user = Sentry.getCurrentHub().getScope().getUser();
const userFeedback = {
event_id: eventId;
email: user.email
name: user.username
comments: 'I really like your App, thanks!'
}
Sentry.captureUserFeedback(userFeedback);
Note that feedback needs to be coupled to an event but as in the example above, you can just use Sentry.captureMessage
to generate one.
You could also collect feedback in a custom way if an error happens and use the SDK to send it along:
Sentry.init({
dsn: '__DSN__',
beforeSend: event => {
const userFeedback = collectYourUserFeedback();
const feedback = {
...userFeedback,
event_id: event.event_id.
}
Sentry.captureUserFeedback(feedback);
return event;
}
})
@sentry/tracing exports (#7611)With this release, we officially deprecate all exports from the @sentry/tracing package, in favour of using them
directly from the main SDK package. The @sentry/tracing package will be removed in a future major release.
Please take a look at the Migration docs for more details.
fetch (#7626)LocalVariables integration on Node < v18 (#7748)Redirects as exceptions (#7731)handleErrorWithSentry (#7674)Work in this release contributed by @de-don and @TrySound. Thank you for your contributions!
sentryHandle (#7598)This release adds support for Performance Monitoring in our SvelteKit SDK for the client/server. We've also changed how you should initialize your SDK. Please read our updated SvelteKit README instructions for more details.
ignoreTransactions option (#7594)You can now easily filter out certain transactions from being sent to Sentry based on their name.
Sentry.init({
ignoreTransactions: ['/api/healthcheck', '/ping'],
});
We've added an integration that automatically instruments Undici and Node server
side fetch. This supports Undici v4.7.0 or higher and requires Node v16.7.0 or higher. After adding the integration
outgoing requests made by Undici will have associated spans and breadcrumbs in Sentry.
Sentry.init({
integrations: [new Sentry.Integrations.Undici()],
});
In our Next.js and SvelteKit SDKs, this integration is automatically added.
We've added a new middleware for trpc that automatically adds TRPC information to Sentry transactions. This middleware is meant to be used in combination with a Sentry server integration (Next.js, Express, etc).
import { initTRPC } from '@trpc/server';
import * as Sentry from '@sentry/node';
const t = initTRPC.context().create();
const sentryMiddleware = t.middleware(
Sentry.Handlers.trpcMiddleware({
attachRpcInput: true,
}),
);
const sentrifiedProcedure = t.procedure.use(sentryMiddleware);
@sentry/tracing packageWith 7.46.0 you no longer require the @sentry/tracing package to use tracing and performance monitoring with the
Sentry JavaScript SDKs. The @sentry/tracing package will be removed in a future major release, but can still be used
with no changes.
Please see the Migration docs for more details.
LocalVariables integration (#7637)This fixes a memory leak in the opt-in
LocalVariables integration, which adds
local variables to the stacktraces sent to Sentry. The minimum recommended version to use the LocalVariables is now
7.46.0.
responseStatus, decodedBodySize to perf entries (#7613)pageload transaction starts at timeOrigin (#7632)abs_path from stack trace (reverting #7167) (#7623)NEXT_NOT_FOUND and NEXT_REDIRECT errors (#7642)abs_path frames (#7619)beforeFiles in rewrites (#7649)Work in this release contributed by @aldenquimby and @bertho-zero. Thank you for your contributions!
replay_id to transaction DSC (#7571)ignoreErrors only applies to error events (#7573)This release introduces the first alpha version of @sentry/sveltekit, our newest JavaScript SDK for Sveltekit. Check
out the README for usage instructions and what to expect from this alpha release.
request_body_size & response_body_size to fetch/xhr (#7407)rrweb and rrweb-player (#7508)handleError wrapper (#7411)handleError wrapper (#7406)init functions (#7408)Sentry.init calls into server and client bundles (#7391)BrowserTracing in non-tracing bundles (#7479)RewriteFrames (#7506)window.location for SSR environments (#7518)Replay rrweb changes:
@sentry-internal/rrweb was updated from 1.105.0 to 1.106.0:
Work in this release contributed by @woochanleee and @baked-dev. Thank you for your contribution!
profilesSampler option to node client type (#7385)Array.findIndex() as it is ES5 incompatible (#7400)require call to fix monkey patching (#7430)cause to send exceptions (#7350)originalException has type unknown (#7361)Object.values() (#7360)normalizeDepth (#7379)require calls (#7377)Replay rrweb changes:
@sentry-internal/rrweb was updated from 1.104.1 to 1.105.0 (#7314):
onMutation option to record (#70)<input type='submit' value='Btn text'> is masked (#69)environment everywhere (#7327)routeLabel: 'path' to opt-out of using name (#7326)X-Forwarded-For Http header (#7329)Work in this release contributed by @OliverJAsh. Thank you for your contribution!
This release adds a new package, @sentry/angular-ivy, which is our Angular SDK with full support for Angular's
rendering engine, Ivy.
This release also adds a new enableTracing option, which can be used instead of tracesSampleRate for an easier
setup. Related to this, the hasTracingEnabled utility function was moved from @sentry/tracing to @sentry/core. The
old export from @sentry/tracing has been deprecated and will be removed in v8.
debug_meta (#7168)VERCEL_ENV as environment (#7227)enableTracing option (#7238)Replay rrweb changes:
@sentry-internal/rrweb was updated from 1.103.0 to 1.104.1 (#7238):
typings/types (#60)autoplay attribute from audio/video tags (#59)modulepreload as well (#52)maskAllInputs:false (#61)rootShadowHost check (#50)abs_path into stack frame object (#7167)Offline integration (#7063)PerformanceResourceTiming.renderBlockingStatus (#7127)maxWait (#7207, #7208)Work in this release contributed by @lucas-zimermann. Thank you for your contribution!
This release includes changes and fixes around text masking and blocking in Replay's rrweb dependency. See versions
1.102.0 and
1.103.0.
blockSelector for blocking elements as wellaria-labeltextareamaskAllText optionSDK Changes:
async in stack frame urls (#7131)this in http integration (#7135)defaultStackParser from tracing CDN bundles (#7116)LocalVariables, Improve frame matching for ESM (#7049)Work in this release contributed by @JamesHenry. Thank you for your contribution!
This Release re-introduces the accidentally removed but still deprecated maskInputOptions option for Session Replay.
Furthermore, replays are now stopped instead of paused when a rate limit is encountered.
maskInputOptions (#6981)BaseClient integrations added after init (#7011)Session Replay is deprecating privacy options in favor of a more streamlined API. Please see the
Replay migration guide for
further information. Additionally, the following configuration options will no longer be configurable: slimDOMOptions,
recordCanvas, inlineStylesheet, collectFonts, inlineImages.
ErrorBoundary, withErrorBoundary and showReportDialog (#6987)_app instead of main (#7009)scope.getLastBreadcrumb if available (#6969)Work in this release contributed by @boblauer. Thank you for your contribution!
This release adds automatic injection of the Next.js SDK into serverside app directory bundles, allowing users to call
the Sentry SDK in server components.
app directory (#6927)\ (#6932)Work in this release contributed by @mdtro. Thank you for your contribution!
With this release, the sample rate for Session Replays will default to 0. We recommend explicitly setting the sample
rate via the replaysSessionSampleRate and replaysOnErrorSampleRate options.
app directory browser bundle (#6812)includeLocalVariables option to enable LocalVariables integration (#6874)flush method to integration (#6776)enableLongTask to option of BrowserTracing (#6837)initialFlushDelay option (#6867)Work in this release contributed by @h3rmanj. Thank you for your contribution!
The Next.js SDK now supports error and performance monitoring for Next.js
middleware and
Edge API routes. To set it up, add a sentry.edge.config.js or
sentry.edge.config.ts file to the root of your project and initialize the SDK:
// sentry.edge.config.js or sentry.edge.config.ts
import * as Sentry from '@sentry/nextjs';
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
Sentry.init({
dsn: SENTRY_DSN || 'YOUR DSN HERE',
tracesSampleRate: 1.0,
});
The Next.js will automatically instrument Edge API routes and middleware. If you want to opt out of automatic
instrumentation of middleware can use the autoInstrumentMiddleware option in the sentry object of your Next.js
configuration:
const moduleExports = {
sentry: {
autoInstrumentMiddleware: false,
},
};
Middleware can be manually instrumented by using the wrapMiddlewareWithSentry function.
withSentryConfig as an alternative to the sentry property (#6721)checkoutEveryNms (#6722)isBuild() and IS_BUILD (#6727)addIntegration method to client (#6651)replay_event type for events (#6481)LocalVariables integration to capture local variables to stack frames (#6478)replayType from tags and into replay_event (#6658)res.json and res.send (#6674)res.end to fix next export (#6682)instrumentSever (#6592)Work in this release contributed by @rjoonas, @Naddiseo, and @theofidry. Thank you for your contributions!
This update includes a change to the @sentry/nextjs SDK that may increase response times of requests in applications
deployed to Vercel or AWS lambdas to ensure that error events are sent consistently. Additionally, Next.js applications
deployed to Vercel or AWS lambdas may also see an uptick in sent transactions. (for more information see #6578)
getSdkMetadata to Client (#6643)prepareEvent util & ensure dropping replays works (#6522)maskAllText selector (#6637)pageload transactions early (#6609)_metadata in client options (#6600)index.server.ts to avoid TS error (#6577)this through wrappers (#6572)undefined as possible event type (#6584)This release exports the Session Replay integration via @sentry/browser and all framework SDKs building on top of it.
Going forward, the @sentry/replay package doesn't have to be installed explicitly to use Replay. Furthermore, this
release increases the maximim replay session duration from 30 minutes to 1 hour.
Replay integration from Browser SDK (#6508)MAX_SESSION_LIFE to 1 hour (#6561)beforeSend handling defensive for different event types (#6507)maskAllText selector more specific (#6544)dsn in envelope header if tunneling is active (#6568)Work in this release contributed by @theofidry. Thank you for your contribution!
Work in this release contributed by @theofidry. Thank you for your contribution!
scope.getLastBreadcrumb() (#6495)_waitForError with recordingMode (#6489)reportAllChanges option (#6456)This patch corrects an oversight on our end which caused the Sentry Replay integration CDN bundles to be ignored when uploading bundles to our CDN. If you want to use the Replay CDN bundles, please use version 7.24.1 or newer.
encodeLocation method (#6439)Work in this release contributed by @theofidry. Thank you for your contribution!
This release bumps the
@sentry/replay package from
version 0.x to 7.24.0. Along with this version bump, we're introducing a few breaking changes. Take a look at the
Replay migration guide for
further information. The Replay version bump is the result of moving the package into the Sentry JavaScript SDK monorepo
which aligns the version with our other JS SDK packages. Important: If you're using Replay with version 7.24.x or
newer, make sure to also upgrade your other @sentry/* packages to this version.
assetPrefix option (#6388)basePath for assetPrefix if needed (#6424)profilesSampleRate into BaseNodeOptions (#6409)getClientIpAddress throws error. (#6400)Work in this release contributed by @tomgrossman and @ZachGawlik. Thank you for your contributions!
__SENTRY_RELEASE__ magic string (#6322)profilesSampleRate (#6318)sentry_reportAllChanges tag (#6360)Work in this release contributed by @zhiyan114. Thank you for your contributions!
event as third argument to recordDroppedEvent (#6289)RouteObject typing. (#6274)normalizeRemixRequest calls. (#6296)RequestData. (#6276)withSentryConfig from serverless bundles (#6267)createBrowserRouter. (#6172)tracePropagationTargets to instrumentOutgoingRequests (#6259)<unknown> component name default in TraceDirective (#6222)_sdkProcessingMetadata when cloning scope (#6218)shouldAttachHeaders not fall back to default values (#6238)excludeServerRoutes config option (#6207)Http integration (#6191)distDir in webpack plugin options (#6214)This release adds a new SDK, @sentry/opentelemetry-node, which is available as an alpha release to integrate OpenTelemetry performance tracing with Sentry. Give it a try and let us know if you have any feedback or problems with using it. (#6000)
This release also deprecates the tracingOrigins option in favor of using shouldCreateSpanForRequest and
tracePropagationTargets. See #6176 for details.
transaction.setContext method (#6154)instrumenter on Span & Transaction (#6136)tracingOrigins (#6176)This release adds the beforeSendTransaction callback to all JS SDKs, letting you make changes to or drop transactions
before they're sent to Sentry. This callback works identically to beforeSend, just for transactions.
beforeSendTransaction (#6121)OnUncaughtException integration that allows mimicking native uncaught error exit behaviour
(#6137)tracePropagationTargets option to browser routing instrumentation (#6080)onUncaughtException integration to remain excluded (#6148)uncaughtException-handlers are registered
(#6138)getServerRequestHandler (#6072)onCLS() (#6091)tracingOrigins not applying (#6079)This release standardizes our SDKs to use the MIT License, which is our
standard license for Sentry SDKs. We were previously using the BSD 3-Clause License
in @sentry/browser,@sentry/core, @sentry/gatsby, @sentry/hub, @sentry/integrations, @sentry/node,
@sentry/react, @sentry/types, @sentry/typescript, and @sentry/utils.
This release also updates the behaviour of
tracingOrigins
to no longer affect span creation. tracingOrigins will only affect if sentry-trace and baggage headers are
attached to outgoing requests. To control span creation, use the
shouldCreateSpanForRequest
option.
RequestData integration for server-side requests (#6007)[Symbol.toStringTag]: 'Module' to CJS files (#6043)tracingOrigins when creating spans (#6039)WINDOW from utils (#6024)RequestData integration default (#5980)RequestData integration in express handlers (#5990)Work in this release contributed by @philipatkinson, @Rockergmail, @ys-zhifu, and @koenpunt. Thank you for your contributions!
Special shoutout to @Tofandel who helped fix a bug in Jest that was affecting the Sentry JavaScript SDKs!
This release adds the withSentryConfig feature to the Svelte SDK. It replaces the now deprecated Svelte
componentTrackingPreprocessor which will be removed in the next major release.
@sentry/types (#5982)withSentryConfig function to wrap User Svelte Configuration (#5936)src folder (#5984)withSentryConfig and NextConfig (#5967)global.ts -> worldwide.ts (#5969)constToVarPlugin (#5970)pageProps in _app (#5945)getGlobalObject as it's no longer used (#5949)Work in this release contributed by @jeengbe. Thank you for your contribution!
This release deprecates @sentry/hub and all of it's exports. All of the @sentry/hub exports have moved to
@sentry/core. @sentry/hub will be removed in the next major release.
autoInstrumentServerFunctions per default (#5919)react-router-dom (#5897)@sentry/hub code to @sentry/core (#5823)Work in this release contributed by @outsideris and @JonasKruckenberg. Thank you for your contributions!
Work in this release contributed by @outsideris. Thank you for your contributions!
DeviceContext.boot_time if os.uptime() is valid (#5859)resolvers is not defined in ApolloServer config (#5850)getGlobalObject (#5809)pathname being passed in object in instrumentServer (#5782)nextjs.data.server ops (#5830)react-router-dom in Express wrapper. (#5810)connection.downlink measurement (#5794)withSentry in all backend wrappers (#5814)RequestData integration for errors (#5729)@sentry/node (#5759)Work in this release contributed by @Auspicus and @dagroe. Thank you for your contributions!
keepalive flag (#5697)normalizeDepth option when creating an event from a plain objectnormalizeDepth when creating an event from unknown inputcontexts cannot be overridden and culture never included (#5677)This release adds an environment check in @sentry/nextjs for Vercel deployments (using the VERCEL_ENV env variable),
and only enables SentryWebpackPlugin if the environment is production. To override this,
setting disableClientWebpackPlugin or disableServerWebpackPlugin to false
now takes precedence over other checks, rather than being a no-op. Note: Overriding this is not recommended! It can
increase build time and clog Release Health data in Sentry with inaccurate noise.
getInitialProps and getServerSideProps (#5593)getInitialProps of _app, _document and _error (#5604)event.contexts for Node.js (#5512)RewriteFrames (#5625)Work in this release contributed by @lucas-zimerman, @GJZwiers, and @mohd-akram. Thank you for your contributions!
This release introduces updates the
tracingOrigins option
to not attach any headers/create an spans when supplied with an empty array ([]). Previously, we would supply the
default tracingOrigins if an empty array was set as the tracingOrigins option.
SentryError isn't an error (#5562)getInitialProps (#5587)This release introduces the first alpha version of @sentry/svelte, our newest JavaScript SDK! For details on how to
use it, please see the README and
the tracking GitHub issue.
json responses from root loader functions. (#5548)autoWrapDataFetchers option into experiments object (#5540)Work in this release contributed by @augustuswm. Thank you for your contribution!
This release adds the
tracePropagationTargets
option to the Sentry Node SDK.
tracePropagationTargets option (#5521): as a part of gecko protocol regex group. (#4153)transpileClientSDK option from correct location (#5516)sentry-trace and baggage via root loader. (#5509)NextConfigObject type (#5514)distDir value back into index.server.ts (#5479)This release adds the transpileClientSDK flag to the Next.JS SDK Webpack config. This option makes WebPack transpile
the SDK code to the same transpilation level as the user code. By specifying this option, the Next.JS SDK works in older
browsers that do not support ES6 or ES6+ (e.g. object spread) features.
captureUnderscoreErrorException argument type (#5463)eval when checking for sentry-cli binary (#5447)isBuild into an exported function (#5444)_error.js (#5378)RewriteFrames helper value (#5445)Work in this release contributed by @mitchheddles. Thank you for your contribution!
sentry_client to auth headers (#5413)documentRequest function name. (#5404)ok responses as errors. (#5405)This release adds the source field to
all outgoing transactions. See the tracking GH issue for
more details.
This release also re-enables lambda layer releases for the Node Serverless SDK.
Work in this release contributed by @moishinetzer. Thank you for your contribution!
This release removes the user_id and the transaction field from the dynamic sampling context data that is attached
to outgoing requests as well as sent to Relay.
This release adds the sendDefaultPii flag to the Sentry.init options. When using performance monitoring capabilities
of the SDK, it controls whether user IDs (set via Sentry.setUser) are propagated in the baggage header of outgoing
HTTP requests. This flag is set to false per default, and acts as an opt-in mechanism for sending potentially
sensitive data. If you want to attach user IDs to Sentry transactions and traces, set this flag to true but keep in
mind that this is potentially sensitive information.
user_id to DSC if sendDefaultPii is true (#5344)Work in this release contributed by @jkcorrea and @nfelger. Thank you for your contributions!
This release includes the first published version of @sentry/remix.
This release contains the alpha version of @sentry/remix, our newest JavaScript SDK! For details on how to use it,
please see the README and
the tracking GitHub issue.
Attention: Due to an oversight, the @sentry/remix package is only published as part of the 7.4.1 release.
Work in this release contributed by @MichaelDeBoey. Thank you for your contribution!
Special thank you to @jacob-ebey for pointing us in the right direction while we were working on the Remix SDK: https://github.com/jacob-ebey/remix-sentry.
Work in this release contributed by @MasterOdin. Thank you for your contribution!
_error.js (#5259)ParseRequestOptions to be passed to request handler (#5287)Work in this release contributed by @Arinono. Thank you for your contribution!
showReportDialog from NextJS SDK (#5242)@sentry/utils (#5257)Work in this release contributed by @Arinono and @slaesh. Thank you for your contributions!
http transport (#5209)dropUndefinedKeys (#5201)debug.min bundle variant config (#5192)handlers module (#5190)Version 7 of the Sentry JavaScript SDK brings a variety of features and fixes including bundle size and performance improvements, brand new integrations, support for the attachments API, and key bug fixes.
This release does not change or remove any top level public API methods (captureException, captureMessage), and only
requires changes to certain configuration options or custom clients/integrations/transports.
Note: The v7 version of the JavaScript SDK requires a self-hosted version of Sentry 20.6.0 or higher. If you are using
a version of self-hosted Sentry (aka onpremise) older than 20.6.0 then you
will need to upgrade.
For detailed overview of all the changes, please see our v7 migration guide.
If you are a regular consumer of the Sentry JavaScript SDK you only need to focus on the general items. The internal
breaking changes are aimed at libraries that build on top of and extend the JavaScript SDK (like
@sentry/electron or
@sentry/react-native).
bundle.min.js to ES6 instead of ES5.
ES5 bundles are still available at bundle.es5.min.js. (#4958)Severity enum for bundle size reasons.
Please use string literals instead. (#4926)critical Severity level. (#5032)whitelistUrls and blacklistUrls have been renamed to allowUrls and denyUrls in the Sentry.init() options.
(#4850)BaseClient and it's child classes now require transport, stackParser, and integrations to be
explicitly passed in. This was done to improve tree-shakability. (#4927)@sentry/* npm packages.
See details in our migration docs.. (#4900) (#4901)Transport API. This means
custom transports will have to be adjusted accordingly..baggage HTTP header alongside sentry-trace header to
propogate additional tracing related information.. (#5133)registerRequestInstrumentation export to instrumentOutgoingRequests in @sentry/tracing. (#4859)UserAgent integration to HttpContext. (#5027)BrowserTracing integration's maxTransactionDuration option with finalTimeout option in the
@sentry/tracing package and reset idleTimeout based on activities count. This should improve accuracy of
web-vitals like LCP by 20-30%. (#5044)@sentry/angular to be compiled by the angular compiler. (#4641)@sentry/minimal package in favour of using @sentry/hub. (#4971)ignoreSentryErrors option from AWS lambda SDK. Errors originating from the SDK will now always be caught
internally. (#4994)Integrations.BrowserTracing export from @sentry/nextjs. Please import BrowserTracing from
@sentry/nextjs directly.id property from BrowserTracing integration.SDK_NAME export from @sentry/browser, @sentry/node, @sentry/tracing and @sentry/vue packages.
(#5040)Angular, Ember, and Vue integrations from @sentry/integrations
in favour of the explicit framework packages: @sentry/angular, @sentry/ember, and @sentry/vue.
(#4893)Status, RequestSessionStatus, and SessionStatus.. Deprecated
enums SpanStatus and Severity. This was done to save on bundle size. (#4891)
(#4889) (#4890)@sentry/apm package. (#4845)user field from DSN interface. publicKey should be used instead. (#4864)getActiveDomain method and DomainAsCarrier type from @sentry/hub. (#4858)eventStatusFromHttpCode to save on bundle size.event.stacktrace field. (#4885)showReportDialog method on BrowserClient (#4973)startSpan and child methods (#4849)frameContextLines options (#4884)Sentry from window in the Gatsby SDK (#4857)API class from @sentry/core.. (#4848)Session class to use a more functional approach.. (#5054)Backend class in favour of moving functionality into the Client class (for more details, see
#4911 and
#4919).@sentry-internal/typescript (#4940)_invokeClient function from @sentry/hub (#4972)@sentry/utils (#5066)name field to EventProcessor (#4932)setMeasurement public API (#4933)addEventListener instrumentation (#5147)gcpfunction (#5097)querySelector when not available (#5160)dropUndefinedKeys (#5163)