9.0.0
Version 9.0.0 marks a major release of the Sentry Dart/Flutter SDKs containing breaking changes.
The goal of this release is the following:
- Bump the minimum Dart and Flutter versions to
3.5.0
and3.24.0
respectively - Bump the minimum Android API version to 21
- Add interoperability with the Sentry Javascript SDK in Flutter Web for features such as release health and reporting native JS errors
- GA the Session Replay feature
- Provide feature flag support as well as Firebase Remote Config support
- Trim down unused and potentially confusing APIs
How To Upgrade
Please carefully read through the migration guide in the Sentry docs on how to upgrade from version 8 to version 9
Breaking changes
- Increase minimum SDK version requirements to Dart
v3.5.0
and Flutterv3.24.0
(#2643) - Update naming of
LoadImagesListIntegration
toLoadNativeDebugImagesIntegration
(#2833) - Set sentry-native backend to
crashpad
by default andbreakpad
for Windows ARM64 (#2791)- Setting the
SENTRY_NATIVE_BACKEND
environment variable will override the defaults.
- Setting the
- Remove manual TTID implementation (#2668)
- Remove screenshot option
attachScreenshotOnlyWhenResumed
(#2664) - Remove deprecated
beforeScreenshot
(#2662) - Remove old user feedback api (#2686)
- This is replaced by
beforeCaptureScreenshot
- This is replaced by
- Remove deprecated loggers (#2685)
- Remove user segment (#2687)
- Enable Sentry JS SDK native integration by default (#2688)
- Remove
enableTracing
(#2695) - Remove
options.autoAppStart
andsetAppStartEnd
(#2680) - Bump Drift min version to
2.24.0
and useQueryInterceptor
instead ofQueryExecutor
(#2679) - Add hint for transactions (#2675)
BeforeSendTransactionCallback
now has aHint
parameter
- Remove
dart:html
usage in favour ofpackage:web
(#2710) - Remove max response body size (#2709)
- Responses are now only attached if size is below ~0.15mb
- Responses are attached to the
Hint
object, which can be read inbeforeSend
/beforeSendTransaction
callbacks viahint.response
. - For now, only the
dio
integration is supported.
- Enable privacy masking for screenshots by default (#2728)
- Set option
anrEnabled
totrue
by default (#2878) - Mutable Data Classes (#2818)
- Some SDK classes do not have
const
constructors anymore. - The
copyWith
andclone
methods of SDK classes were deprecated.
- Some SDK classes do not have
// old
options.beforeSend = (event, hint) {
event = event.copyWith(release: 'my-release');
return event;
}
// new
options.beforeSend = (event, hint) {
event.release = 'my-release';
return event;
}
Features
- Sentry Structured Logs Beta (#2919)
- The old
SentryLogger
has been renamed toSdkLogCallback
and can be accessed throughoptions.log
now. - Adds support for structured logging though
Sentry.logger
:
- The old
// Enable in `SentryOptions`:
options.enableLogs = true;
// Use `Sentry.logger`
Sentry.logger.info("This is a info log.");
Sentry.logger.warn("This is a warning log with attributes.", attributes: {
'string-attribute': SentryLogAttribute.string('string'),
'int-attribute': SentryLogAttribute.int(1),
'double-attribute': SentryLogAttribute.double(1.0),
'bool-attribute': SentryLogAttribute.bool(true),
});
// Manually track a feature flag
Sentry.addFeatureFlag('my-feature', true);
// or use the Sentry Firebase Remote Config Integration (sentry_firebase_remote_config package is required)
// Add the integration to automatically track feature flags from firebase remote config.
await SentryFlutter.init(
(options) {
options.dsn = 'https://example@sentry.io/add-your-dsn-here';
options.addIntegration(
SentryFirebaseRemoteConfigIntegration(
firebaseRemoteConfig: yourFirebaseRemoteConfig,
),
);
},
);
- Properly generates and links trace IDs for errors and spans (#2869, #2861):
- With
SentryNavigatorObserver
- each navigation event starts a new trace. - Without
SentryNavigatorObserver
on non-web platforms - a new trace is started from app
lifecycle hooks. - Web without
SentryNavigatorObserver
- the same trace ID is reused until the page is
refreshed or closed.
- With
- Add support for Flutter Web release health (#2794)
- Requires using
SentryNavigatorObserver
;
- Requires using
Behavioral changes
- Set log level to
warning
by default whendebug = true
(#2836) - Set HTTP client breadcrumbs log level based on response status code (#2847)
- 5xx is mapped to
SentryLevel.error
- 4xx is mapped to
SentryLevel.warning
- 5xx is mapped to
- Parent-child relationship for the PlatformExceptions and Cause (#2803)
- Improves and more accurately represent exception groups
- Disabled by default as it may cause issues to group differently
- You can enable this feature by setting
options.groupException = true
Improvements
- Replay: improve Android native interop performance by using JNI (#2670)
- Align User Feedback API (#2949)
- Don’t apply breadcrumbs and extras from scope to feedback events
- Capture session replay when processing feedback events
- Record
feedback
client report for dropped feedback events - Record
feedback
client report for errors when usingHttpTransport
- Truncate feedback message to max 4096 characters (#2954)
- Replay: Mask RichText Widgets by default (#2975)