Releases: getsentry/sentry-java
8.7.0
Features
-
UI Profiling GA
Continuous Profiling is now GA, named UI Profiling. To enable it you can use one of the following options. More info can be found at https://docs.sentry.io/platforms/android/profiling/.
Note: Bothoptions.profilesSampler
andoptions.profilesSampleRate
must not be set to enable UI Profiling.
To keep the same transaction-based behaviour, without the 30 seconds limitation, you can use thetrace
lifecycle mode.<application> <!-- Enable UI profiling, adjust in production env. This is evaluated only once per session --> <meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="1.0" /> <!-- Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) --> <meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" /> <!-- Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes --> <meta-data android:name="io.sentry.traces.profiling.start-on-app-start" android:value="true" /> </application>
import io.sentry.ProfileLifecycle; import io.sentry.android.core.SentryAndroid; SentryAndroid.init(context, options -> { // Enable UI profiling, adjust in production env. This is evaluated only once per session options.setProfileSessionSampleRate(1.0); // Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) options.setProfileLifecycle(ProfileLifecycle.TRACE); // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes options.setStartProfilerOnAppStart(true); });
import io.sentry.ProfileLifecycle import io.sentry.android.core.SentryAndroid SentryAndroid.init(context, { options -> // Enable UI profiling, adjust in production env. This is evaluated only once per session options.profileSessionSampleRate = 1.0 // Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) options.profileLifecycle = ProfileLifecycle.TRACE // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes options.isStartProfilerOnAppStart = true })
Fixes
- Compress Screenshots on a background thread (#4295)
8.6.0
Behavioral Changes
- The Sentry SDK will now crash on startup if mixed versions have been detected (#4277)
- On
Sentry.init
/SentryAndroid.init
the SDK now checks if all Sentry Java / Android SDK dependencies have the same version. - While this may seem like a bad idea at first glance, mixing versions of dependencies has a very high chance of causing a crash later. We opted for a controlled crash that's hard to miss.
- Note: This detection only works for new versions of the SDK, so please take this as a reminder to check your SDK version alignment manually when upgrading the SDK to this version and then you should be good.
- The SDK will also print log messages if mixed versions have been detected at a later point. (#4270)
- This takes care of cases missed by the startup check above due to older versions.
- On
Features
- Increase http timeouts from 5s to 30s to have a better chance of events being delivered without retry (#4276)
- Add
MANIFEST.MF
to Sentry JARs (#4272) - Retain baggage sample rate/rand values as doubles (#4279)
- Introduce fatal SDK logger (#4288)
- We use this to print out messages when there is a problem that prevents the SDK from working correctly.
- One example for this is when the SDK has been configured with mixed dependency versions where we print out details, which module and version are affected.
Fixes
- Do not override user-defined
SentryOptions
(#4262) - Session Replay: Change bitmap config to
ARGB_8888
for screenshots (#4282) - The
MANIFEST.MF
ofsentry-opentelemetry-agent
now hasImplementation-Version
set to the raw version (#4291)- An example value would be
8.6.0
- The value of the
Sentry-Version-Name
attribute looks likesentry-8.5.0-otel-2.10.0
- An example value would be
- Fix tags missing for compose view hierarchies (#4275)
- Do not leak SentryFileInputStream/SentryFileOutputStream descriptors and channels (#4296)
- Remove "not yet implemented" from
Sentry.flush
comment (#4305)
Internal
- Added
platform
to SentryEnvelopeItemHeader (#4287)- Set
android
platform to ProfileChunk envelope item header
- Set
Dependencies
7.22.5 (Stable)
Fixes
- Session Replay: Change bitmap config to
ARGB_8888
for screenshots (#4282)
7.22.4
8.5.0 (Stable)
Features
-
Add native stack frame address information and debug image metadata to ANR events (#4061)
- This enables symbolication for stripped native code in ANRs
-
Add Continuous Profiling Support (#3710)
To enable Continuous Profiling use the
Sentry.startProfiler
andSentry.stopProfiler
experimental APIs. Sampling rate can be set throughoptions.profileSessionSampleRate
, which defaults to null (disabled).
Note: Bothoptions.profilesSampler
andoptions.profilesSampleRate
must not be set to enable Continuous Profiling.import io.sentry.ProfileLifecycle; import io.sentry.android.core.SentryAndroid; SentryAndroid.init(context) { options -> // Currently under experimental options: options.getExperimental().setProfileSessionSampleRate(1.0); // In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler // In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes options.getExperimental().setProfileLifecycle(ProfileLifecycle.MANUAL); } // Start profiling Sentry.startProfiler(); // After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped. Sentry.stopProfiler();
import io.sentry.ProfileLifecycle import io.sentry.android.core.SentryAndroid SentryAndroid.init(context) { options -> // Currently under experimental options: options.experimental.profileSessionSampleRate = 1.0 // In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler // In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes options.experimental.profileLifecycle = ProfileLifecycle.MANUAL } // Start profiling Sentry.startProfiler() // After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped. Sentry.stopProfiler()
To learn more visit Sentry's Continuous Profiling documentation page.
Fixes
- Reduce excessive CPU usage when serializing breadcrumbs to disk for ANRs (#4181)
- Ensure app start type is set, even when ActivityLifecycleIntegration is not running (#4250)
- Use
SpringServletTransactionNameProvider
as fallback for Spring WebMVC (#4263)- In certain cases the SDK was not able to provide a transaction name automatically and thus did not finish the transaction for the request.
- We now first try
SpringMvcTransactionNameProvider
which would provide the route as transaction name. - If that does not return anything, we try
SpringServletTransactionNameProvider
next, which returns the URL of the request.
Behavioral Changes
- The user's
device.name
is not reported anymore via the device context, even ifoptions.isSendDefaultPii
is enabled (#4179)
Dependencies
7.22.3
8.4.0
Fixes
- The SDK now handles
null
on many APIs instead of expecting a nonnull
value (#4245)- Certain APIs like
setTag
,setData
,setExtra
,setContext
previously caused aNullPointerException
when invoked with eithernull
key or value. - The SDK now tries to have a sane fallback when
null
is passed and no longer throwsNullPointerException
- If
null
is passed, the SDK will- do nothing if a
null
key is passed, returningnull
for non void methods - remove any previous value if the new value is set to
null
- do nothing if a
- Certain APIs like
- Add support for setting in-app-includes/in-app-excludes via AndroidManifest.xml (#4240)
- Modifications to OkHttp requests are now properly propagated to the affected span / breadcrumbs (#4238)
- Please ensure the SentryOkHttpInterceptor is added last to your OkHttpClient, as otherwise changes to the
Request
by subsequent interceptors won't be considered
- Please ensure the SentryOkHttpInterceptor is added last to your OkHttpClient, as otherwise changes to the
- Fix "class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy" (#4206)
- In this case we cannot report the
Throwable
to Sentry as it's not available - If you are using OpenTelemetry v1
OpenTelemetryAppender
, please consider upgrading to v2
- In this case we cannot report the
- Pass OpenTelemetry span attributes into TracesSampler callback (#4253)
SamplingContext
now has agetAttribute
method that grants access to OpenTelemetry span attributes via their String key (e.g.http.request.method
)
- Fix AbstractMethodError when using SentryTraced for Jetpack Compose (#4255)
- Assume
http.client
for spanop
if not a root span (#4257) - Avoid unnecessary copies when using
CopyOnWriteArrayList
(#4247)- This affects in particular
SentryTracer.getLatestActiveSpan
which would have previously copied all child span references. This may have causedOutOfMemoryError
on certain devices due to high frequency of calling the method.
- This affects in particular
Features
- The SDK now automatically propagates the trace-context to the native layer. This allows to connect errors on different layers of the application. (#4137)
- Capture OpenTelemetry span events (#3564)
- OpenTelemetry spans may have exceptions attached to them (
openTelemetrySpan.recordException
). We can now send those to Sentry as errors. - Set
capture-open-telemetry-events=true
insentry.properties
to enable it - Set
sentry.capture-open-telemetry-events=true
in Springsapplication.properties
to enable it - Set
sentry.captureOpenTelemetryEvents: true
in Springsapplication.yml
to enable it
- OpenTelemetry spans may have exceptions attached to them (
Behavioural Changes
- Use
java.net.URI
for parsing URLs inUrlUtils
(#4210)- This could affect grouping for issues with messages containing URLs that fall in known corner cases that were handled incorrectly previously (e.g. email in URL path)
Internal
- Also use port when checking if a request is made to Sentry DSN (#4231)
- For our OpenTelemetry integration we check if a span is for a request to Sentry
- We now also consider the port when performing this check
Dependencies
7.22.2
7.22.1
8.3.0 (Stable)
Features
- Add HTTP server request headers from OpenTelemetry span attributes to sentry
request
in payload (#4102)- You have to explicitly enable each header by adding it to the OpenTelemetry config
- Please only enable headers you actually want to send to Sentry. Some may contain sensitive data like PII, cookies, tokens etc.
- We are no longer adding request/response headers to
contexts/otel/attributes
of the event.
- The
ignoredErrors
option is now configurable via the manifest propertyio.sentry.traces.ignored-errors
(#4178) - A list of active Spring profiles is attached to payloads sent to Sentry (errors, traces, etc.) and displayed in the UI when using our Spring or Spring Boot integrations (#4147)
- This consists of an empty list when only the default profile is active
- Added
enableTraceIdGeneration
to the AndroidOptions. This allows Hybrid SDKs to "freeze" and control the trace and connect errors on different layers of the application (4188) - Move to a single NetworkCallback listener to reduce number of IPC calls on Android (#4164)
- Add GraphQL Apollo Kotlin 4 integration (#4166)
- Add support for async dispatch requests to Spring Boot 2 and 3 (#3983)
- To enable it, please set
sentry.keep-transactions-open-for-async-responses=true
inapplication.properties
orsentry.keepTransactionsOpenForAsyncResponses: true
inapplication.yml
- To enable it, please set
- Add constructor to JUL
SentryHandler
for disabling external config (#4208)
Fixes
- Filter strings that cannot be parsed as Regex no longer cause an SDK crash (#4213)
- This was the case e.g. for
ignoredErrors
,ignoredTransactions
andignoredCheckIns
- We now simply don't use such strings for Regex matching and only use them for String comparison
- This was the case e.g. for
SentryOptions.setTracePropagationTargets
is no longer marked internal (#4170)- Session Replay: Fix crash when a navigation breadcrumb does not have "to" destination (#4185)
- Session Replay: Cap video segment duration to maximum 5 minutes to prevent endless video encoding in background (#4185)
- Check
tracePropagationTargets
in OpenTelemetry propagator (#4191)- If a URL can be retrieved from OpenTelemetry span attributes, we check it against
tracePropagationTargets
before attachingsentry-trace
andbaggage
headers to outgoing requests - If no URL can be retrieved we always attach the headers
- If a URL can be retrieved from OpenTelemetry span attributes, we check it against
- Fix
ignoredErrors
,ignoredTransactions
andignoredCheckIns
being unset by external options likesentry.properties
or ENV vars (#4207)- Whenever parsing of external options was enabled (
enableExternalConfiguration
), which is the default for many integrations, the values set onSentryOptions
passed toSentry.init
would be lost - Even if the value was not set in any external configuration it would still be set to an empty list
- Whenever parsing of external options was enabled (
Behavioural Changes
- The class
io.sentry.spring.jakarta.webflux.ReactorUtils
is now deprecated, please useio.sentry.reactor.SentryReactorUtils
in the newsentry-reactor
module instead (#4155)- The new module will be exposed as an
api
dependency when usingsentry-spring-boot-jakarta
(Spring Boot 3) orsentry-spring-jakarta
(Spring 6).
Therefore, if you're using one of those modules, changing your imports will suffice.
- The new module will be exposed as an