A Sentry SDK for Java, Android and other JVM languages.
We released our first Alpha version of the SDK with support. To get access, it requires adding your Sentry org to our feature flag. Please let us know on the waitlist if you're interested
Sentry.metrics()
.increment(
"button_login_click", // key
1.0, // value
null, // unit
mapOf( // tags
"provider" to "e-mail"
)
)
To learn more about Sentry Developer Metrics, head over to our Java and Android docs page.enableScopePersistence
option to disable PersistingScopeObserver
used for ANR reporting which may increase performance overhead. Defaults to true
(#3218)
Runnable
/Callable
/Supplier
is executed instead of setting it to the hub that was used on the thread where the Runnable
/Callable
/Supplier
was created.options.isEnableSpotlight = true
to enable SpotlightRuntimeException
is thrown by the system (#3212)
RuntimeInit$MethodAndArgsCaller
to have them split up properly by the original root cause exceptionio.sentry.profiling.enable-app-start
, other than the already existing io.sentry.traces.profiling.sample-rate
.isForNextAppStart
flag, to adjust startup profiling sampling programmatically.
Relevant PRs:OnFrameMetricsAvailableListener
(#3111)mechanism:AppExitInfo
HostnameVerifier
option as it's flagged by security tools of some app stores (#3150)
ITransportFactory
through SentryOptions.setTransportFactory()
, where you can copy over most of the parts like HttpConnection
and AsyncHttpTransport
from the SDK with necessary modificationsmonitor
/check_in
in client reports and rate limiter (#3096)graphql-java
version 21 (#3090)SentryJobListener
release
and other fields for ANRs reported with mechanism:AppExitInfo
(#3074)opentelemetry-sdk
to 1.33.0
and opentelemetry-javaagent
to 1.32.0
(#3112)enable-backpressure-handling=true
.tracesSampleRate
automatically.tracesSampleRate
to its original value.options.isEnablePerformanceV2 = true
SentryOkHttpEventListener
even without transactions (#3087)io.sentry.exception.SentryHttpClientException
from obfuscation to display proper issue title on Sentry (#3093)Version 7 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
minSdk
level to 19 (Android 4.4)Sentry.getSpan
now returns the root transaction, which should improve the span hierarchy and make it leanersentry-okhttp
artifact is unbundled from Android and can be used in pure JVM-only apps
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.
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.
sentry-kotlin-extensions
, it requires kotlinx-coroutines-core
version 1.6.1
or higher now (#2838)SentryOkHttpUtils
was removed from public API as it's been exposed by mistake (#3005)Scope
now implements the IScope
interface, therefore some methods like ScopeCallback.run
accept IScope
now (#3066)startTransaction
overloads (#2964)
TransactionOptions
object instead of having separate parameters for certain optionsTransactionOptions
has defaults set and can be customized, for example:// old
val transaction = Sentry.startTransaction("name", "op", bindToScope = true)
// new
val transaction = Sentry.startTransaction("name", "op", TransactionOptions().apply { isBindToScope = true })
Sentry.getSpan()
returns the root span/transaction instead of the latest span (#2855)sentry-android-okhttp
or sentry-apollo-3
integrations. You can customize what errors you want/don't want to have reported for OkHttp and Apollo3 respectively.onResume
(#2851)deadline_exceeded
when reaching the deadlinesendDefaultPii
if an encoder
has been configured (#2976)maxSpans
setting (defaults to 1000) is enforced for nested child spans which means a single transaction can have maxSpans
number of children (nested or not) at most (#3065)ScopeCallback
in withScope
is now always executed (#3066)sentry-android-okhttp
was deprecated in favour of the new sentry-okhttp
module. Make sure to replace io.sentry.android.okhttp
package name with io.sentry.okhttp
before the next major, where the classes will be removed (#3005)SendCachedEnvelopeIntegration
SendCachedEnvelopeFireAndForgetIntegration
as mentioned in https://docs.sentry.io/platforms/java/configuration/#configuring-offline-caching and provide your own implementation of IConnectionStatusProvider
via SentryOptions
sentry-okhttp
module to support instrumenting OkHttp in non-Android projects (#3005)getMyMemoryState()
instead of getRunningAppProcesses()
to retrieve process importance (#3004)
aborted
in case a crash happens (#2938)
default
interface methods to proper implementations in each interface implementor (#2847)
SentryOkHttpInterceptor.BeforeSpanCallback
was not finishing span when it was dropped (#2958)