Releases: getsentry/sentry-java
7.6.0
Features
- Experimental: Add support for Sentry Developer Metrics (#3205, #3238, #3248, #3250)
Use the Metrics API to track processing time, download sizes, user signups, and conversion rates and correlate them back to tracing data in order to get deeper insights and solve issues faster. Our API supports counters, distributions, sets, gauges and timers, and it's easy to get started:To learn more about Sentry Developer Metrics, head over to our Java and Android docs page.Sentry.metrics() .increment( "button_login_click", // key 1.0, // value null, // unit mapOf( // tags "provider" to "e-mail" ) )
7.5.0
Features
- Add support for measurements at span level (#3219)
- Add
enableScopePersistence
option to disablePersistingScopeObserver
used for ANR reporting which may increase performance overhead. Defaults totrue
(#3218)- When disabled, the SDK will not enrich ANRv2 events with scope data (e.g. breadcrumbs, user, tags, etc.)
- Configurable defaults for Cron - MonitorConfig (#3195)
- We now display a warning on startup if an incompatible version of Spring Boot is detected (#3233)
- This should help notice a mismatching Sentry dependency, especially when upgrading a Spring Boot application
- Experimental: Add Metrics API (#3205)
Fixes
- Ensure performance measurement collection is not taken too frequently (#3221)
- Fix old profiles deletion on SDK init (#3216)
- Fix hub restore point in wrappers: SentryWrapper, SentryTaskDecorator and SentryScheduleHook (#3225)
- We now reset the hub to its previous value on the thread where the
Runnable
/Callable
/Supplier
is executed instead of setting it to the hub that was used on the thread where theRunnable
/Callable
/Supplier
was created.
- We now reset the hub to its previous value on the thread where the
- Fix add missing thread name/id to app start spans (#3226)
7.4.0
Features
- Add new threshold parameters to monitor config (#3181)
- Report process init time as a span for app start performance (#3159)
- (perf-v2): Calculate frame delay on a span level (#3197)
- Resolve spring properties in @SentryCheckIn annotation (#3194)
- Experimental: Add Spotlight integration (#3166)
- For more details about Spotlight head over to https://spotlightjs.com/
- Set
options.isEnableSpotlight = true
to enable Spotlight
Fixes
- Don't wait on main thread when SDK restarts (#3200)
- Fix Jetpack Compose widgets are not being correctly identified for user interaction tracing (#3209)
- Fix issue title on Android when a wrapping
RuntimeException
is thrown by the system (#3212)- This will change grouping of the issues that were previously titled
RuntimeInit$MethodAndArgsCaller
to have them split up properly by the original root cause exception
- This will change grouping of the issues that were previously titled
7.3.0
Features
- Added App Start profiling
- This depends on the new option
io.sentry.profiling.enable-app-start
, other than the already existingio.sentry.traces.profiling.sample-rate
. - Sampler functions can check the new
isForNextAppStart
flag, to adjust startup profiling sampling programmatically.
Relevant PRs: - Decouple Profiler from Transaction (#3101)
- Add options and sampling logic (#3121)
- Add ContentProvider and start profile (#3128)
- This depends on the new option
- Extend internal performance collector APIs (#3102)
- Collect slow and frozen frames for spans using
OnFrameMetricsAvailableListener
(#3111) - Interpolate total frame count to match span duration (#3158)
Fixes
- Avoid multiple breadcrumbs from OkHttpEventListener (#3175)
- Apply OkHttp listener auto finish timestamp to all running spans (#3167)
- Fix not eligible for auto proxying warnings (#3154)
- Set default fingerprint for ANRv2 events to correctly group background and foreground ANRs (#3164)
- This will improve grouping of ANRs that have similar stacktraces but differ in background vs foreground state. Only affects newly-ingested ANR events with
mechanism:AppExitInfo
- This will improve grouping of ANRs that have similar stacktraces but differ in background vs foreground state. Only affects newly-ingested ANR events with
- Fix UserFeedback disk cache name conflicts with linked events (#3116)
Breaking changes
- Remove
HostnameVerifier
option as it's flagged by security tools of some app stores (#3150)- If you were using this option, you have 3 possible paths going forward:
- Provide a custom
ITransportFactory
throughSentryOptions.setTransportFactory()
, where you can copy over most of the parts likeHttpConnection
andAsyncHttpTransport
from the SDK with necessary modifications - Get a certificate for your server through e.g. Let's Encrypt
- Fork the SDK and add the hostname verifier back
- Provide a custom
- If you were using this option, you have 3 possible paths going forward:
Dependencies
7.2.0
Features
- Handle
monitor
/check_in
in client reports and rate limiter (#3096) - Add support for
graphql-java
version 21 (#3090)
Fixes
- Avoid concurrency in AndroidProfiler performance data collection (#3130)
- Improve thresholds for network changes breadcrumbs (#3083)
- SchedulerFactoryBeanCustomizer now runs first so user customization is not overridden (#3095)
- If you are setting global job listeners please also add
SentryJobListener
- If you are setting global job listeners please also add
- Ensure serialVersionUID of Exception classes are unique (#3115)
- Get rid of "is not eligible for getting processed by all BeanPostProcessors" warnings in Spring Boot (#3108)
- Fix missing
release
and other fields for ANRs reported withmechanism:AppExitInfo
(#3074)
Dependencies
- Bump
opentelemetry-sdk
to1.33.0
andopentelemetry-javaagent
to1.32.0
(#3112)
7.1.0
Features
- Support multiple debug-metadata.properties (#3024)
- Automatically downsample transactions when the system is under load (#3072)
- You can opt into this behaviour by setting
enable-backpressure-handling=true
. - We're happy to receive feedback, e.g. in this GitHub issue
- When the system is under load we start reducing the
tracesSampleRate
automatically. - Once the system goes back to healthy, we reset the
tracesSampleRate
to its original value.
- You can opt into this behaviour by setting
- (Android) Experimental: Provide more detailed cold app start information (#3057)
- Attaches spans for Application, ContentProvider, and Activities to app-start timings
- Uses Process.startUptimeMillis to calculate app-start timings
- To enable this feature set
options.isEnablePerformanceV2 = true
- Move slow+frozen frame calculation, as well as frame delay inside SentryFrameMetricsCollector (#3100)
- Extract Activity Breadcrumbs generation into own Integration (#3064)
Fixes
- Send breadcrumbs and client error in
SentryOkHttpEventListener
even without transactions (#3087) - Keep
io.sentry.exception.SentryHttpClientException
from obfuscation to display proper issue title on Sentry (#3093) - (Android) Fix wrong activity transaction duration in case SDK init is deferred (#3092)
Dependencies
7.0.0
Version 7 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
- Bumping
minSdk
level to 19 (Android 4.4) - The SDK will now listen to connectivity changes and try to re-upload cached events when internet connection is re-established additionally to uploading events on app restart
Sentry.getSpan
now returns the root transaction, which should improve the span hierarchy and make it leaner- Multiple improvements to reduce probability of the SDK causing ANRs
- New
sentry-okhttp
artifact is unbundled from Android and can be used in pure JVM-only apps- Thanks @ToppleTheNun for their contribution!
Sentry Self-hosted Compatibility
This SDK version is compatible with a self-hosted version of Sentry 22.12.0
or higher. If you are using an older version of self-hosted Sentry (aka onpremise), you will need to upgrade. If you're using sentry.io
no action is required.
Sentry Integrations Version Compatibility (Android)
Make sure to align all Sentry dependencies to the same version when bumping the SDK to 7.+, otherwise it will crash at runtime due to binary incompatibility. (E.g. if you're using -timber
, -okhttp
or other packages)
For example, if you're using the Sentry Android Gradle plugin with the autoInstallation
feature (enabled by default), make sure to use version 4.+ of the gradle plugin together with version 7.+ of the SDK. If you can't do that for some reason, you can specify sentry version via the plugin config block:
sentry {
autoInstallation {
sentryVersion.set("7.0.0")
}
}
Similarly, if you have a Sentry SDK (e.g. sentry-android-core
) dependency on one of your Gradle modules and you're updating it to 7.+, make sure the Gradle plugin is at 4.+ or specify the SDK version as shown in the snippet above.
Breaking Changes
- Bump min API to 19 (#2883)
- If you're using
sentry-kotlin-extensions
, it requireskotlinx-coroutines-core
version1.6.1
or higher now (#2838) - Move enableNdk from SentryOptions to SentryAndroidOptions (#2793)
- Apollo v2 BeforeSpanCallback now allows returning null (#2890)
SentryOkHttpUtils
was removed from public API as it's been exposed by mistake (#3005)Scope
now implements theIScope
interface, therefore some methods likeScopeCallback.run
acceptIScope
now (#3066)- Cleanup
startTransaction
overloads (#2964)- We have reduced the number of overloads by allowing to pass in a
TransactionOptions
object instead of having separate parameters for certain options TransactionOptions
has defaults set and can be customized, for example:
- We have reduced the number of overloads by allowing to pass in a
// old
val transaction = Sentry.startTransaction("name", "op", bindToScope = true)
// new
val transaction = Sentry.startTransaction("name", "op", TransactionOptions().apply { isBindToScope = true })
Behavioural Changes
- Android only:
Sentry.getSpan()
returns the root span/transaction instead of the latest span (#2855) - Capture failed HTTP and GraphQL (Apollo) requests by default (#2794)
- This can increase your event consumption and may affect your quota, because we will report failed network requests as Sentry events by default, if you're using the
sentry-android-okhttp
orsentry-apollo-3
integrations. You can customize what errors you want/don't want to have reported for OkHttp and Apollo3 respectively.
- This can increase your event consumption and may affect your quota, because we will report failed network requests as Sentry events by default, if you're using the
- Measure AppStart time till First Draw instead of
onResume
(#2851) - Automatic user interaction tracking: every click now starts a new automatic transaction (#2891)
- Previously performing a click on the same UI widget twice would keep the existing transaction running, the new behavior now better aligns with other SDKs
- Add deadline timeout for automatic transactions (#2865)
- This affects all automatically generated transactions on Android (UI, clicks), the default timeout is 30s, meaning the automatic transaction will be force-finished with status
deadline_exceeded
when reaching the deadline
- This affects all automatically generated transactions on Android (UI, clicks), the default timeout is 30s, meaning the automatic transaction will be force-finished with status
- Set ip_address to {{auto}} by default, even if sendDefaultPII is disabled (#2860)
- Instead use the "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io
- Raw logback message and parameters are now guarded by
sendDefaultPii
if anencoder
has been configured (#2976) - The
maxSpans
setting (defaults to 1000) is enforced for nested child spans which means a single transaction can havemaxSpans
number of children (nested or not) at most (#3065) - The
ScopeCallback
inwithScope
is now always executed (#3066)
Deprecations
sentry-android-okhttp
was deprecated in favour of the newsentry-okhttp
module. Make sure to replaceio.sentry.android.okhttp
package name withio.sentry.okhttp
before the next major, where the classes will be removed (#3005)
Other Changes
Features
- Observe network state to upload any unsent envelopes (#2910)
- Android: it works out-of-the-box as part of the default
SendCachedEnvelopeIntegration
- JVM: you'd have to install
SendCachedEnvelopeFireAndForgetIntegration
as mentioned in https://docs.sentry.io/platforms/java/configuration/#configuring-offline-caching and provide your own implementation ofIConnectionStatusProvider
viaSentryOptions
- Android: it works out-of-the-box as part of the default
- Add
sentry-okhttp
module to support instrumenting OkHttp in non-Android projects (#3005) - Do not filter out Sentry SDK frames in case of uncaught exceptions (#3021)
- Do not try to send and drop cached envelopes when rate-limiting is active (#2937)
Fixes
- Use
getMyMemoryState()
instead ofgetRunningAppProcesses()
to retrieve process importance (#3004)- This should prevent some app stores from flagging apps as violating their privacy
- Reduce flush timeout to 4s on Android to avoid ANRs (#2858)
- Reduce timeout of AsyncHttpTransport to avoid ANR (#2879)
- Do not overwrite UI transaction status if set by the user (#2852)
- Capture unfinished transaction on Scope with status
aborted
in case a crash happens (#2938)- This will fix the link between transactions and corresponding crashes, you'll be able to see them in a single trace
- Fix Coroutine Context Propagation using CopyableThreadContextElement (#2838)
- Fix don't overwrite the span status of unfinished spans (#2859)
- Migrate from
default
interface methods to proper implementations in each interface implementor (#2847)- This prevents issues when using the SDK on older AGP versions (< 4.x.x)
- Reduce main thread work on init (#3036)
- Move Integrations registration to background on init (#3043)
- Fix
SentryOkHttpInterceptor.BeforeSpanCallback
was not finishing span when it was dropped (#2958)
6.34.0
Features
- Add current activity name to app context (#2999)
- Add
MonitorConfig
param toCheckInUtils.withCheckIn
(#3038)- This makes it easier to automatically create or update (upsert) monitors.
- (Internal) Extract Android Profiler and Measurements for Hybrid SDKs (#3016)
- (Internal) Remove SentryOptions dependency from AndroidProfiler (#3051)
- (Internal) Add
readBytesFromFile
for use in Hybrid SDKs (#3052) - (Internal) Add
getProguardUuid
for use in Hybrid SDKs (#3054)
Fixes
- Fix SIGSEV, SIGABRT and SIGBUS crashes happening after/around the August Google Play System update, see #2955 for more details (fix provided by Native SDK bump)
- Ensure DSN uses http/https protocol (#3044)