Recent Releases of https://github.com/getsentry/sentry-java
https://github.com/getsentry/sentry-java - 8.21.0
Fixes
- Only set log template for logging integrations if formatted message differs from template (#4682)
Features
- Add support for Spring Boot 4 and Spring 7 (#4601)
- NOTE: Our
sentry-opentelemetry-agentless-springis not working yet for Spring Boot 4. Please usesentry-opentelemetry-agentuntil OpenTelemetry has support for Spring Boot 4.
- NOTE: Our
- Replace
UUIDGeneratorimplementation with Apache licensed code (#4662) - Replace
Randomimplementation with MIT licensed code (#4664) - Add support for
varsattribute inSentryStackFrame(#4686)- Breaking change: The type of the
varsattribute has been changed fromMap<String, String>toMap<String, Object>.
- Breaking change: The type of the
- Kotlin
Published by sentry-release-bot[bot] 9 months ago
https://github.com/getsentry/sentry-java - 8.20.0
Fixes
- Do not use named capturing groups for regular expressions (#4652)
- This fixes a crash on Android versions below 8.0 (API level 26)
Features
- Add onDiscard to enable users to track the type and amount of data discarded before reaching Sentry (#4612)
- Stub for setting the callback on
Sentry.init:java Sentry.init(options -> { ... options.setOnDiscard( (reason, category, number) -> { // Your logic to process discarded data }); });
- Stub for setting the callback on
- Kotlin
Published by sentry-release-bot[bot] 9 months ago
https://github.com/getsentry/sentry-java - 8.19.1
Fixes
- Do not store No-Op scopes onto OpenTelemetry Context when wrapping (#4631)
- In 8.18.0 and 8.19.0 the SDK could break when initialized too late.
- Kotlin
Published by sentry-release-bot[bot] 10 months ago
https://github.com/getsentry/sentry-java - 8.19.0
Features
- Add a
isEnableSystemEventBreadcrumbsExtrasoption to disable reporting system events extras for breadcrumbs (#4625)
Improvements
- Session Replay: Use main thread looper to schedule replay capture (#4542)
- Use single
LifecycleObserverand multi-cast it to the integrations interested in lifecycle states (#4567) - Add
sentry.originattribute to logs (#4618)- This helps identify which integration captured a log event
- Prewarm
SentryExecutorServicefor better performance at runtime (#4606)
Fixes
- Cache network capabilities and status to reduce IPC calls (#4560)
- Deduplicate battery breadcrumbs (#4561)
- Remove unused method in ManifestMetadataReader (#4585)
- Have single
NetworkCallbackregistered at a time to reduce IPC calls (#4562) - Do not register for SystemEvents and NetworkCallbacks immediately when launched with non-foreground importance (#4579)
- Limit ProGuard keep rules for native methods within
sentry-android-ndkto theio.sentry.**namespace. (#4427)- If you relied on the Sentry SDK to keep native method names for JNI compatibility within your namespace, please review your ProGuard rules and ensure the configuration still works. Especially when you're not consuming any of the default Android proguard rules (
proguard-android.txtorproguard-android-optimize.txt) the following config should be present:-keepclasseswithmembernames class * { native <methods>; }
- If you relied on the Sentry SDK to keep native method names for JNI compatibility within your namespace, please review your ProGuard rules and ensure the configuration still works. Especially when you're not consuming any of the default Android proguard rules (
- Fix abstract method error in
SentrySupportSQLiteDatabase(#4597) - Ensure frame metrics listeners are registered/unregistered on the main thread (#4582)
- Do not report cached events as lost (#4575)
- Previously events were recorded as lost early despite being retried later through the cache
- Move and flush unfinished previous session on init (#4624)
- This removes the need for unnecessary blocking our background queue for 15 seconds in the case of a background app start
- Switch to compileOnly dependency for compose-ui-material (#4630)
- This fixes
StackOverflowErrorwhen using OSS Licenses plugin
- This fixes
Dependencies
- Kotlin
Published by sentry-release-bot[bot] 10 months ago
https://github.com/getsentry/sentry-java - 8.18.0
Features
- Add
SentryUserFeedbackButtonComposable (#4559)- Also added
Sentry.showUserFeedbackDialogstatic method
- Also added
- Add deadlineTimeout option (#4555)
- Add Ktor client integration (#4527)
- To use the integration, add a dependency on
io.sentry:sentry-ktor-client, then install theSentryKtorClientPluginon yourHttpClient, e.g.:kotlin val client = HttpClient(Java) { install(io.sentry.ktorClient.SentryKtorClientPlugin) { captureFailedRequests = true failedRequestTargets = listOf(".*") failedRequestStatusCodes = listOf(HttpStatusCodeRange(500, 599)) } }
- To use the integration, add a dependency on
Fixes
- Allow multiple UncaughtExceptionHandlerIntegrations to be active at the same time (#4462)
- Prevent repeated scroll target determination during a single scroll gesture (#4557)
- This should reduce the number of ANRs seen in
SentryGestureListener
- This should reduce the number of ANRs seen in
- Do not use Sentry logging API in JUL if logs are disabled (#4574)
- This was causing Sentry SDK to log warnings: "Sentry Log is disabled and this 'logger' call is a no-op."
- Do not use Sentry logging API in Log4j2 if logs are disabled (#4573)
- This was causing Sentry SDK to log warnings: "Sentry Log is disabled and this 'logger' call is a no-op."
- SDKs send queue is no longer shutdown immediately on re-init (#4564)
- This means we're no longer losing events that have been enqueued right before SDK re-init.
- Reduce scope forking when using OpenTelemetry (#4565)
Sentry.withScopenow has the correct current scope passed to the callback. Previously our OpenTelemetry integration forked scopes an additional.- Overall the SDK is now forking scopes a bit less often.
- Kotlin
Published by sentry-release-bot[bot] 10 months ago
https://github.com/getsentry/sentry-java - 8.17.0
Features
- Send Timber logs through Sentry Logs (#4490)
- Enable the Logs feature in your
SentryOptionsor with theio.sentry.logs.enabledmanifest option and the SDK will automatically send Timber logs to Sentry, if the TimberIntegration is enabled. - The SDK will automatically detect Timber and use it to send logs to Sentry.
- Enable the Logs feature in your
- Send logcat through Sentry Logs (#4487)
- Enable the Logs feature in your
SentryOptionsor with theio.sentry.logs.enabledmanifest option and the SDK will automatically send logcat logs to Sentry, if the Sentry Android Gradle plugin is applied. - To set the logcat level check the Logcat integration documentation.
- Enable the Logs feature in your
- Read build tool info from
sentry-debug-meta.propertiesand attach it to events (#4314)
Dependencies
- Bump OpenTelemetry (#4532)
opentelemetry-sdkto1.51.0opentelemetry-instrumentationto2.17.0opentelemetry-javaagentto2.17.0opentelemetry-semconvto1.34.0- We are now configuring OpenTelemetry to still behave the same way it did before for span names it generates in GraphQL auto instrumentation (#4537)
Fixes
- Use Spring Boot Starter 3 in
sentry-spring-boot-starter-jakarta(#4545)- While refactoring our dependency management, we accidentally added Spring Boot 2 and Spring Boot Starter 2 as dependencies of
sentry-spring-boot-starter-jakarta, which is intended for Spring Boot 3. - Now, the correct dependencies (Spring Boot 3 and Spring Boot Starter 3) are being added.
- While refactoring our dependency management, we accidentally added Spring Boot 2 and Spring Boot Starter 2 as dependencies of
- Kotlin
Published by sentry-release-bot[bot] 11 months ago
https://github.com/getsentry/sentry-java - 7.22.6
Fixes
- Compress Screenshots on a background thread (#4295)
- Improve low memory breadcrumb capturing (#4325)
- Make
SystemEventsBreadcrumbsIntegrationfaster (#4330) - Fix unregister
SystemEventsBroadcastReceiverwhen entering background (#4338)- This should reduce ANRs seen with this class in the stack trace for Android 14 and above
- Pre-load modules on a background thread upon SDK init (#4348)
- Session Replay: Fix inconsistent
segment_id(#4471) - Session Replay: Do not capture current replay for cached events from the past (#4474)
- Session Replay: Fix crash on devices with the Unisoc/Spreadtrum T606 chipset (#4477)
- Session Replay: Fix masking of non-styled
TextComposables (#4361) - Session Replay: Fix masking read-only
TextFieldComposables (#4362) - Fix Session Replay masking for newer versions of Jetpack Compose (1.8+) (#4485)
- Session Replay: Expand fix for crash on devices to all Unisoc/Spreadtrum chipsets (#4510)
- Kotlin
Published by sentry-release-bot[bot] 11 months ago
https://github.com/getsentry/sentry-java - 8.16.1-alpha.2
Fixes
- Optimize scope when maxBreadcrumb is 0 (#4504)
- Fix javadoc on TransportResult (#4528)
- Session Replay: Fix
IllegalArgumentExceptionwhenBitmapis initialized with non-positive values (#4536) - Set thread information on transaction from OpenTelemetry attributes (#4478)
Internal
- Flattened PerformanceCollectionData (#4505)
- Kotlin
Published by sentry-release-bot[bot] 11 months ago
https://github.com/getsentry/sentry-java - 8.16.0
Features
- Send JUL logs to Sentry as logs (#4518)
- You need to enable the logs feature, either in
sentry.properties:properties logs.enabled=true - Or, if you manually initialize Sentry, you may also enable logs on
Sentry.init:java Sentry.init(options -> { ... options.getLogs().setEnabled(true); }); - It is also possible to set the
minimumLevelinlogging.properties, meaning any log message >= the configured level will be sent to Sentry and show up under Logs:properties io.sentry.jul.SentryHandler.minimumLevel=CONFIG
- You need to enable the logs feature, either in
- Send Log4j2 logs to Sentry as logs (#4517)
- You need to enable the logs feature either in
sentry.properties:properties logs.enabled=true - If you manually initialize Sentry, you may also enable logs on
Sentry.init:java Sentry.init(options -> { ... options.getLogs().setEnabled(true); }); - It is also possible to set the
minimumLevelinlog4j2.xml, meaning any log message >= the configured level will be sent to Sentry and show up under Logs:xml <Sentry name="Sentry" dsn="your DSN" minimumBreadcrumbLevel="DEBUG" minimumEventLevel="WARN" minimumLevel="DEBUG" />
- You need to enable the logs feature either in
- Kotlin
Published by sentry-release-bot[bot] 11 months ago
https://github.com/getsentry/sentry-java - 8.15.1
Fixes
- Enabling Sentry Logs through Logback in Spring Boot config did not work in 3.15.0 (#4523)
- Kotlin
Published by sentry-release-bot[bot] 11 months ago
https://github.com/getsentry/sentry-java - 8.15.0
Fixes
- No longer send out empty log envelopes (#4497)
- Session Replay: Expand fix for crash on devices to all Unisoc/Spreadtrum chipsets (#4510)
- Log parameter objects are now turned into
StringviatoString(#4515)- One of the two
SentryLogEventAttributeValueconstructors did not convert the value previously.
- One of the two
- Logs are now flushed on shutdown (#4503)
- User Feedback: Do not redefine system attributes for
SentryUserFeedbackButton, but reference them instead (#4519)
Features
- Add chipset to device context (#4512)
- Send Logback logs to Sentry as logs (#4502)
- You need to enable the logs feature and can also set the
minimumLevelfor log events:xml <appender name="sentry" class="io.sentry.logback.SentryAppender"> <options> <!-- NOTE: Replace the test DSN below with YOUR OWN DSN to see the events from this app in your Sentry project/dashboard --> <dsn>https://502f25099c204a2fbf4cb16edc5975d1@o447951.ingest.sentry.io/5428563</dsn> <logs> <enabled>true</enabled> </logs> </options> <!-- Demonstrates how to modify the minimum values --> <!-- Default for Events is ERROR --> <minimumEventLevel>WARN</minimumEventLevel> <!-- Default for Breadcrumbs is INFO --> <minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel> <!-- Default for Log Events is INFO --> <minimumLevel>INFO</minimumLevel> </appender> - For Spring Boot you may also enable it in
application.properties/application.yml:properties sentry.logs.enabled=true sentry.logging.minimum-level=error - If you manually initialize Sentry, you may also enable logs on
Sentry.init:java Sentry.init(options -> { ... options.getLogs().setEnabled(true); }); - Enabling via
sentry.propertiesis also possible:properties logs.enabled=true
- You need to enable the logs feature and can also set the
- Automatically use
SentryOptions.Logs.BeforeSendLogCallbackSpring beans (#4509)
Dependencies
- Kotlin
Published by sentry-release-bot[bot] 11 months ago
https://github.com/getsentry/sentry-java - 8.14.0
Fixes
- Fix Session Replay masking for newer versions of Jetpack Compose (1.8+) (#4485)
Features
- Add New User Feedback Widget (#4450)
- This widget is a custom button that can be used to show the user feedback form
Add New User Feedback form (#4384)
- We now introduce SentryUserFeedbackDialog, which extends AlertDialog, inheriting the show() and cancel() methods, among others. To use it, just instantiate it and call show() on the instance (Sentry must be previously initialized). For customization options, please check the User Feedback documentation. ```java import io.sentry.android.core.SentryUserFeedbackDialog;
new SentryUserFeedbackDialog.Builder(context).create().show();
kotlin import io.sentry.android.core.SentryUserFeedbackDialogSentryUserFeedbackDialog.Builder(context).create().show() ```
Add
user.id,user.nameanduser.emailto log attributes (#4486)User
nameattribute has been deprecated, please useusernameinstead (#4486)Add device (
device.brand,device.modelanddevice.family) and OS (os.nameandos.version) attributes to logs (#4493)Serialize
preContextandpostContextinSentryStackFrame(#4482)
Internal
- User Feedback now uses SentryUser.username instead of SentryUser.name (#4494)
- Kotlin
Published by sentry-release-bot[bot] 12 months ago
https://github.com/getsentry/sentry-java - 8.13.3
Fixes
- Send UI Profiling app start chunk when it finishes (#4423)
- Republish Javadoc #4457
- Finalize
OkHttpEventeven if no active span inSentryOkHttpInterceptor#4469 - Session Replay: Do not capture current replay for cached events from the past (#4474)
- Session Replay: Correctly capture Dialogs and non full-sized windows (#4354)
- Session Replay: Fix inconsistent
segment_id(#4471) - Session Replay: Fix crash on devices with the Unisoc/Spreadtrum T606 chipset (#4477)
- Kotlin
Published by sentry-release-bot[bot] 12 months ago
https://github.com/getsentry/sentry-java - 8.13.2
Fixes
- Don't apply Spring Boot plugin in
sentry-spring-boot-jakarta(#4456)- The jar for
io.sentry:sentry-spring-boot-jakartais now correctly being built and published to Maven Central.
- The jar for
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.13.0
Features
- Add debug mode for Session Replay masking (#4357)
- Use
Sentry.replay().enableDebugMaskingOverlay()to overlay the screen with the Session Replay masks. - The masks will be invalidated at most once per
frameRate(default 1 fps).
- Use
- Extend Logs API to allow passing in
attributes(#4402)Sentry.logger.lognow takes aSentryLogParameters- Use
SentryLogParameters.create(SentryAttributes.of(...))to pass attributes - Attribute values may be of type
string,boolean,integerordouble. - Other types will be converted to
string. Currently we simply calltoString()but we might offer more in the future. - You may manually flatten complex types into multiple separate attributes of simple types.
- e.g. intead of
SentryAttribute.named("point", Point(10, 20))you may store it asSentryAttribute.integerAttribute("point.x", point.x)andSentryAttribute.integerAttribute("point.y", point.y)
- e.g. intead of
SentryAttribute.named()will automatically infer the type or fall back tostring.SentryAttribute.booleanAttribute()takes aBooleanvalueSentryAttribute.integerAttribute()takes aIntegervalueSentryAttribute.doubleAttribute()takes aDoublevalueSentryAttribute.stringAttribute()takes aStringvalue- We opted for handling parameters via
SentryLogParametersto avoid creating tons of overloads that are ambiguous.
Fixes
- Isolation scope is now forked in
OtelSentrySpanProcessorinstead ofOtelSentryPropagator(#4434)- Since propagator may never be invoked we moved the location where isolation scope is forked.
- Not invoking
OtelSentryPropagator.extractor having asentry-traceheader that failed to parse would cause isolation scope not to be forked. - This in turn caused data to bleed between scopes, e.g. from one request into another
Dependencies
- Bump Spring Boot to
3.5.0(#4111)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.12.0
Features
- Add new User Feedback API (#4286)
- We now introduced Sentry.captureFeedback, which supersedes Sentry.captureUserFeedback
- Add Sentry Log Feature (#4372)
- The feature is disabled by default and needs to be enabled by:
options.getLogs().setEnabled(true)inSentry.init/SentryAndroid.init<meta-data android:name="io.sentry.logs.enabled" android:value="true" />inAndroidManifest.xmllogs.enabled=trueinsentry.propertiessentry.logs.enabled=trueinapplication.propertiessentry.logs.enabled: trueinapplication.yml
- Logs can be captured using
Sentry.logger().info()and similar methods. - Logs also take a format string and arguments which we then send through
String.format. - Please use
options.getLogs().setBeforeSend()to filter outgoing logs
- The feature is disabled by default and needs to be enabled by:
Fixes
- Hook User Interaction integration into running Activity in case of deferred SDK init (#4337)
Dependencies
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.11.1
Fixes
- Fix Android profile chunk envelope type for UI Profiling (#4366)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.11.0
Features
- Make
RequestDetailsResolverpublic (#4326)RequestDetailsResolveris now public and has an additional constructor, making it easier to use a customTransportFactory
Fixes
- Session Replay: Fix masking of non-styled
TextComposables (#4361) - Session Replay: Fix masking read-only
TextFieldComposables (#4362)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.11.0-alpha.1
Features
- Support
globalHubModefor OpenTelemetry (#4349)- Sentry now adds OpenTelemetry spans without a parent to the last known unfinished root span (transaction)
- Previously those spans would end up in Sentry as separate transactions
- Spans created via Sentry API are preferred over those created through OpenTelemetry API or auto instrumentation
- New option
ignoreStandaloneClientSpansthat prevents Sentry from creating transactions for OpenTelemetry spans with kindCLIENT(#4349)- Defaults to
falsemeaning standalone OpenTelemetry spans with kindCLIENTwill be turned into Sentry transactions
- Defaults to
- Make
RequestDetailsResolverpublic (#4326)RequestDetailsResolveris now public and has an additional constructor, making it easier to use a customTransportFactory
Fixes
- Session Replay: Fix masking of non-styled
TextComposables (#4361) - Session Replay: Fix masking read-only
TextFieldComposables (#4362)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.10.0
Features
- Wrap configured OpenTelemetry
ContextStorageProviderif available (#4359)- This is only relevant if you see
java.lang.IllegalStateException: Found multiple ContextStorageProvider. Set the io.opentelemetry.context.ContextStorageProvider property to the fully qualified class name of the provider to use. Falling back to default ContextStorage. Found providers: ... - Set
-Dio.opentelemetry.context.contextStorageProvider=io.sentry.opentelemetry.SentryContextStorageProvideron yourjavacommand - Sentry will then wrap the other
ContextStorageProviderthat has been configured by loading it through SPI - If no other
ContextStorageProvideris available or there are problems loading it, we fall back to usingSentryOtelThreadLocalStorage
- This is only relevant if you see
Fixes
- Update profile chunk rate limit and client report (#4353)
Dependencies
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.10.0-alpha.1
Features
- Support
globalHubModefor OpenTelemetry (#4349)- Sentry now adds OpenTelemetry spans without a parent to the last known unfinished root span (transaction)
- Previously those spans would end up in Sentry as separate transactions
- Spans created via Sentry API are preferred over those created through OpenTelemetry API or auto instrumentation
- New option
ignoreStandaloneClientSpansthat prevents Sentry from creating transactions for OpenTelemetry spans with kindCLIENT(#4349)- Defaults to
falsemeaning standalone OpenTelemetry spans with kindCLIENTwill be turned into Sentry transactions
- Defaults to
Fixes
- Update profile chunk rate limit and client report (#4353)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.9.0
Features
- Add
SentryWrapper.wrapRunnableto wrapRunnablefor use with Sentry (#4332)
Fixes
- Fix TTFD measurement when API called too early (#4297)
- Tag sockets traffic originating from Sentry's HttpConnection (#4340)
- This should suppress the StrictMode's
UntaggedSocketViolation
- This should suppress the StrictMode's
- Reduce debug logs verbosity (#4341)
- Fix unregister
SystemEventsBroadcastReceiverwhen entering background (#4338)- This should reduce ANRs seen with this class in the stack trace for Android 14 and above
Improvements
- Make user interaction tracing faster and do fewer allocations (#4347)
- Pre-load modules on a background thread upon SDK init (#4348)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.9.0-alpha.1
Features
- Add
SentryWrapper.wrapRunnableto wrapRunnablefor use with Sentry (#4332) - Support
globalHubModefor OpenTelemetry- Sentry now adds OpenTelemetry spans without a parent to the last known unfinished root span (transaction)
- Previously those spans would end up in Sentry as separate transactions
Fixes
- Fix TTFD measurement when API called too early (#4297)
- Tag sockets traffic originating from Sentry's HttpConnection (#4340)
- This should suppress the StrictMode's
UntaggedSocketViolation
- This should suppress the StrictMode's
- Reduce debug logs verbosity (#4341)
- Fix unregister
SystemEventsBroadcastReceiverwhen entering background (#4338)- This should reduce ANRs seen with this class in the stack trace for Android 14 and above
Improvements
- Make user interaction tracing faster and do fewer allocations (#4347)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.8.0
Features
- Add
CoroutineExceptionHandlerfor reporting uncaught exceptions in coroutines to Sentry (#4259)- This is now part of
sentry-kotlin-extensionsand can be used together withSentryContextwhen launching a coroutine - Any exceptions thrown in a coroutine when using the handler will be captured (not rethrown!) and reported to Sentry
- It's also possible to extend
CoroutineExceptionHandlerto implement custom behavior in addition to the one we provide by default
- This is now part of
Fixes
- Use thread context classloader when available (#4320)
- This ensures correct resource loading in environments like Spring Boot where the thread context classloader is used for resource loading.
- Improve low memory breadcrumb capturing (#4325)
- Fix do not initialize SDK for Jetpack Compose Preview builds (#4324)
- Fix Synchronize Baggage values (#4327)
Improvements
- Make
SystemEventsBreadcrumbsIntegrationfaster (#4330)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/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: Both options.profilesSampler and options.profilesSampleRate must not be set to enable UI Profiling.
To keep the same transaction-based behaviour, without the 30 seconds limitation, you can use the trace lifecycle mode.
xml
<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>
```java
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);
});
kotlin
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
})
```
- Continuous Profiling - Stop when app goes in background (#4311)
- Continuous Profiling - Add delayed stop (#4293)
- Continuous Profiling - Out of Experimental (#4310)
Fixes
- Compress Screenshots on a background thread (#4295)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.6.0
Behavioral Changes
- The Sentry SDK will now crash on startup if mixed versions have been detected (#4277)
- On
Sentry.init/SentryAndroid.initthe 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.MFto 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_8888for screenshots (#4282) - The
MANIFEST.MFofsentry-opentelemetry-agentnow hasImplementation-Versionset to the raw version (#4291)- An example value would be
8.6.0 - The value of the
Sentry-Version-Nameattribute 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.flushcomment (#4305)
Internal
- Added
platformto SentryEnvelopeItemHeader (#4287)- Set
androidplatform to ProfileChunk envelope item header
- Set
Dependencies
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 7.22.5
Fixes
- Session Replay: Change bitmap config to
ARGB_8888for screenshots (#4282)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 7.22.4
Fixes
- 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)
- Avoid logging an error when a float is passed in the manifest (#4266)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.5.0
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 and Sentry.stopProfiler experimental APIs. Sampling rate can be set through options.profileSessionSampleRate, which defaults to null (disabled).
Note: Both options.profilesSampler and options.profilesSampleRate must not be set to enable Continuous Profiling.
```java 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();
kotlin
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
SpringServletTransactionNameProvideras 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
SpringMvcTransactionNameProviderwhich would provide the route as transaction name. - If that does not return anything, we try
SpringServletTransactionNameProvidernext, which returns the URL of the request.
Behavioral Changes
- The user's
device.nameis not reported anymore via the device context, even ifoptions.isSendDefaultPiiis enabled (#4179)
Dependencies
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 7.22.3
Fixes
- Reduce excessive CPU usage when serializing breadcrumbs to disk for ANRs (#4181)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.4.0
Fixes
- The SDK now handles
nullon many APIs instead of expecting a nonnullvalue (#4245)- Certain APIs like
setTag,setData,setExtra,setContextpreviously caused aNullPointerExceptionwhen invoked with eithernullkey or value. - The SDK now tries to have a sane fallback when
nullis passed and no longer throwsNullPointerException - If
nullis passed, the SDK will - do nothing if a
nullkey is passed, returningnullfor non void methods - remove any previous value if the new value is set to
null
- 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
Requestby 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
Throwableto 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)
SamplingContextnow has agetAttributemethod 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.clientfor spanopif not a root span (#4257) - Avoid unnecessary copies when using
CopyOnWriteArrayList(#4247)- This affects in particular
SentryTracer.getLatestActiveSpanwhich would have previously copied all child span references. This may have causedOutOfMemoryErroron 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=trueinsentry.propertiesto enable it - Set
sentry.capture-open-telemetry-events=truein Springsapplication.propertiesto enable it - Set
sentry.captureOpenTelemetryEvents: truein Springsapplication.ymlto enable it
- OpenTelemetry spans may have exceptions attached to them (
Behavioural Changes
- Use
java.net.URIfor 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
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 7.22.2
Fixes
- Fix AbstractMethodError when using SentryTraced for Jetpack Compose (#4256)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 7.22.1
Fixes
- Fix Ensure app start type is set, even when ActivityLifecycleIntegration is not running (#4216)
- Fix properly reset application/content-provider timespans for warm app starts (#4244)
- Kotlin
Published by sentry-release-bot[bot] about 1 year ago
https://github.com/getsentry/sentry-java - 8.3.0 (Stable)
Features
- Add HTTP server request headers from OpenTelemetry span attributes to sentry
requestin 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/attributesof the event.
- The
ignoredErrorsoption 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
enableTraceIdGenerationto 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=trueinapplication.propertiesorsentry.keepTransactionsOpenForAsyncResponses: trueinapplication.yml
- To enable it, please set
- Add constructor to JUL
SentryHandlerfor 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,ignoredTransactionsandignoredCheckIns - 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.setTracePropagationTargetsis 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
tracePropagationTargetsin OpenTelemetry propagator (#4191)- If a URL can be retrieved from OpenTelemetry span attributes, we check it against
tracePropagationTargetsbefore attachingsentry-traceandbaggageheaders 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,ignoredTransactionsandignoredCheckInsbeing unset by external options likesentry.propertiesor ENV vars (#4207)- Whenever parsing of external options was enabled (
enableExternalConfiguration), which is the default for many integrations, the values set onSentryOptionspassed toSentry.initwould 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.ReactorUtilsis now deprecated, please useio.sentry.reactor.SentryReactorUtilsin the newsentry-reactormodule instead (#4155)- The new module will be exposed as an
apidependency 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
- Kotlin
Published by sentry-release-bot[bot] over 1 year ago
https://github.com/getsentry/sentry-java - 8.2.0
Breaking Changes
- The Kotlin Language version is now set to 1.6 (#3936)
Features
- Create onCreate and onStart spans for all Activities (#4025)
- Add split apks info to the
Appcontext (#3193) - Expose new
withSentryObservableEffectmethod overload that acceptsSentryNavigationListeneras a parameter (#4143)- This allows sharing the same
SentryNavigationListenerinstance across fragments and composables to preserve the trace
- This allows sharing the same
- (Internal) Add API to filter native debug images based on stacktrace addresses (#4089)
- Propagate sampling random value (#4153)
- The random value used for sampling traces is now sent to Sentry and attached to the
baggageheader on outgoing requests
- The random value used for sampling traces is now sent to Sentry and attached to the
- Update
sampleRatethat is sent to Sentry and attached to thebaggageheader on outgoing requests (#4158)- If the SDK uses its
sampleRateortracesSamplercallback, it now updates thesampleRatein Dynamic Sampling Context.
- If the SDK uses its
Fixes
- Log a warning when envelope or items are dropped due to rate limiting (#4148)
- Do not log if
OtelContextScopesStoragecannot be found (#4127)- Previously
java.lang.ClassNotFoundException: io.sentry.opentelemetry.OtelContextScopesStoragewas shown in the log if the class could not be found. - This is just a lookup the SDK performs to configure itself. The SDK also works without OpenTelemetry.
- Previously
- Session Replay: Fix various crashes and issues (#4135)
- Fix
FileNotFoundExceptionwhen trying to read/write.ongoing_segmentfile - Fix
IllegalStateExceptionwhen registeringonDrawListener - Fix SIGABRT native crashes on Motorola devices when encoding a video
- Fix
- Mention javadoc and sources for published artifacts in Gradle
.modulemetadata (#3936) - (Jetpack Compose) Modifier.sentryTag now uses Modifier.Node (#4029)
- This allows Composables that use this modifier to be skippable
Dependencies
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.22.0 (Stable)
Fixes
- Session Replay: Fix various crashes and issues (#4135)
- Fix
FileNotFoundExceptionwhen trying to read/write.ongoing_segmentfile - Fix
IllegalStateExceptionwhen registeringonDrawListener - Fix SIGABRT native crashes on Motorola devices when encoding a video
- Fix
- (Jetpack Compose) Modifier.sentryTag now uses Modifier.Node (#4029)
- This allows Composables that use this modifier to be skippable
Features
- (Internal) Add API to filter native debug images based on stacktrace addresses (#4159)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.1.0
Features
- Add
options.ignoredErrorsto filter out errors that match a certain String or Regex (#4083)- The matching is attempted on
event.message,event.formatted, and{event.throwable.class.name}: {event.throwable.message} - Can be set in
sentry.properties, e.g.ignored-errors=Some error,Another .* - Can be set in environment variables, e.g.
SENTRY_IGNORED_ERRORS=Some error,Another .* - For Spring Boot, it can be set in
application.properties, e.g.sentry.ignored-errors=Some error,Another .*
- The matching is attempted on
- Log OpenTelemetry related Sentry config (#4122)
Fixes
- Avoid logging an error when a float is passed in the manifest (#4031)
- Add
requestdetails to transactions created through OpenTelemetry (#4098)- We now add HTTP request method and URL where Sentry expects it to display it in Sentry UI
- Remove
java.lang.ClassNotFoundExceptiondebug logs when searching for OpenTelemetry marker classes (#4091)- There was up to three of these, one for
io.sentry.opentelemetry.agent.AgentMarker,io.sentry.opentelemetry.agent.AgentlessMarkerandio.sentry.opentelemetry.agent.AgentlessSpringMarker. - These were not indicators of something being wrong but rather the SDK looking at what is available at runtime to configure itself accordingly.
- There was up to three of these, one for
- Do not instrument File I/O operations if tracing is disabled (#4051)
- Do not instrument User Interaction multiple times (#4051)
- Speed up view traversal to find touched target in
UserInteractionIntegration(#4051) - Reduce IPC/Binder calls performed by the SDK (#4058)
Behavioural Changes
- Reduce the number of broadcasts the SDK is subscribed for (#4052)
- Drop
TempSensorBreadcrumbsIntegration - Drop
PhoneStateBreadcrumbsIntegration - Reduce number of broadcasts in
SystemEventsBreadcrumbsIntegration
- Drop
Current list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the SystemEventsBreadcrumbsIntegration as follows:
kotlin
SentryAndroid.init(context) { options ->
options.integrations.removeAll { it is SystemEventsBreadcrumbsIntegration }
options.integrations.add(SystemEventsBreadcrumbsIntegration(context, SystemEventsBreadcrumbsIntegration.getDefaultActions() + listOf(/* your custom actions */)))
}
If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.
- Set mechanism type to suppressed for suppressed exceptions (#4125)
- This helps to distinguish an exceptions cause from any suppressed exceptions in the Sentry UI
Dependencies
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.21.0
Fixes
- Do not instrument File I/O operations if tracing is disabled (#4051)
- Do not instrument User Interaction multiple times (#4051)
- Speed up view traversal to find touched target in
UserInteractionIntegration(#4051) - Reduce IPC/Binder calls performed by the SDK (#4058)
Behavioural Changes
- Reduce the number of broadcasts the SDK is subscribed for (#4052)
- Drop
TempSensorBreadcrumbsIntegration - Drop
PhoneStateBreadcrumbsIntegration - Reduce number of broadcasts in
SystemEventsBreadcrumbsIntegration
- Drop
Current list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the SystemEventsBreadcrumbsIntegration as follows:
kotlin
SentryAndroid.init(context) { options ->
options.integrations.removeAll { it is SystemEventsBreadcrumbsIntegration }
options.integrations.add(SystemEventsBreadcrumbsIntegration(context, SystemEventsBreadcrumbsIntegration.getDefaultActions() + listOf(/* your custom actions */)))
}
If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0
Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
Hubhas been replaced byScopes- New
Scopetypes have been introduced, see "Behavioural Changes" for more details. - Lifecycle tokens have been introduced to manage
Scopelifecycle, see "Behavioural Changes" for more details. - Bumping
minSdklevel to 21 (Android 5.0) - Our
sentry-opentelemetry-agenthas been improved and now works in combination with the rest of Sentry. You may now mix and match OpenTelemetry and Sentry API for instrumenting your application. - The SDK is now compatible with Spring Boot 3.4
- We now support GraphQL v22 (
sentry-graphql-22) - Metrics have been removed
Please take a look at our migration guide in docs.
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.
Breaking Changes
- The Android minSdk level for all Android modules is now 21 (#3852)
- The minSdk level for sentry-android-ndk changed from 19 to 21 (#3851)
- Throw IllegalArgumentException when calling Sentry.init on Android (#3596)
- Metrics have been removed from the SDK (#3774)
- Metrics will return but we don't know in what exact form yet
enableTracingoption (a.k.aenable-tracing) has been removed from the SDK (#3776)- Please set
tracesSampleRateto a value >= 0.0 for enabling performance instead. The default value isnullwhich means performance is disabled.
- Please set
- Replace
synchronizedmethods and blocks withReentrantLock(AutoClosableReentrantLock) (#3715)- If you are subclassing any Sentry classes, please check if the parent class used
synchronizedbefore. Please make sure to use the same lock object as the parent class in that case.
- If you are subclassing any Sentry classes, please check if the parent class used
traceOriginsoption (io.sentry.traces.tracing-originsin manifest) has been removed, please usetracePropagationTargets(io.sentry.traces.trace-propagation-targetsin manifest`) instead (#3780)profilingEnabledoption (io.sentry.traces.profiling.enablein manifest) has been removed, please useprofilesSampleRate(io.sentry.traces.profiling.sample-rateinstead) instead (#3780)shutdownTimeoutoption has been removed, please useshutdownTimeoutMillisinstead (#3780)profilingTracesIntervalMillisoption for Android has been removed (#3780)io.sentry.session-tracking.enablemanifest option has been removed (#3780)Sentry.traceHeaders()method has been removed, please useSentry.getTraceparent()instead (#3718)Sentry.reportFullDisplayed()method has been removed, please useSentry.reportFullyDisplayed()instead (#3717)User.otherhas been removed, please usedatainstead (#3780)SdkVersion.getIntegrations()has been removed, please usegetIntegrationSetinstead (#3780)SdkVersion.getPackages()has been removed, please usegetPackageSet()instead (#3780)Device.languagehas been removed, please uselocaleinstead (#3780)TraceContext.userandTraceContextUserclass have been removed, please useuserIdonTraceContextinstead (#3780)TransactionContext.fromSentryTrace()has been removed, please useSentry.continueTrace()instead (#3780)SentryDataFetcherExceptionHandlerhas been removed, please useSentryGenericDataFetcherExceptionHandlerin combination withSentryInstrumentationinstead (#3780)sentry-android-okhttphas been removed in favor ofsentry-okhttp, removing android dependency from the module (#3510)Contextsno longer extendsConcurrentHashMap, instead we offer a selected set of methods.- User segment has been removed (#3512)
- One of the
AndroidTransactionProfilerconstructors has been removed, please use a different one (#3780) - Use String instead of UUID for SessionId (#3834)
- The
Sessionconstructor now takes aStringinstead of aUUIDfor thesessionIdparameter. Session.getSessionId()now returns aStringinstead of aUUID.
- The
- All status codes below 400 are now mapped to
SpanStatus.OK(#3869) - Change OkHttp sub-spans to span attributes (#3556)
- This will reduce the number of spans created by the SDK
instrumenteroption should no longer be needed as our new OpenTelemetry integration now works in combination with the rest of Sentry
Behavioural Changes
- We're introducing some new
Scopetypes in the SDK, allowing for better control over what data is attached where. Previously there was a stack of scopes that was pushed and popped. Instead we now fork scopes for a given lifecycle and then restore the previous scopes. SinceHubis gone, it is also never cloned anymore. Separation of data now happens through the different scope types while making it easier to manipulate exactly what you need without having to attach data at the right time to have it apply where wanted.- Global scope is attached to all events created by the SDK. It can also be modified before
Sentry.inithas been called. It can be manipulated usingSentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... }). - Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request. It can also be used for other isolation purposes. It can be manipulated using
Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... }). The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring@Asyncand more. - Current scope is forked often and data added to it is only added to events that are created while this scope is active. Data is also passed on to newly forked child scopes but not to parents. It can be manipulated using
Sentry.configureScope(ScopeType.CURRENT, (scope) -> { ... }).
- Global scope is attached to all events created by the SDK. It can also be modified before
Sentry.popScopehas been deprecated, please call.close()on the token returned bySentry.pushScopeinstead or use it in a way described in more detail in our migration guide.- We have chosen a default scope that is used for
Sentry.configureScope()as well as API likeSentry.setTag()- For Android the type defaults to
CURRENTscope - For Backend and other JVM applicatons it defaults to
ISOLATIONscope
- For Android the type defaults to
- Event processors on
Scopecan now be ordered by overriding thegetOrdermethod on implementations ofEventProcessor. NOTE: This order only applies to event processors onScopebut notSentryOptionsat the moment. Feel free to request this if you need it. Hubis deprecated in favor ofScopes, alongside someHubrelevant APIs. More details can be found in our migration guide.- Send file name and path only if
isSendDefaultPiiistrue(#3919) - (Android) Enable Performance V2 by default (#3824)
- With this change cold app start spans will include spans for ContentProviders, Application and Activity load.
- (Android) Replace thread id with kernel thread id in span data (#3706)
- (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native (#3189)
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
- Checkout the
sentry-samples/sentry-samples-androidexample on how to configure CMake and consumesentry.h
- The user ip-address is now only set to
"{{auto}}"ifsendDefaultPiiis enabled (#4072)- This change gives you control over IP address collection directly on the client
Features
- The SDK is now compatible with Spring Boot 3.4 (#3939)
- Our
sentry-opentelemetry-agenthas been completely reworked and now plays nicely with the rest of the Java SDK- You may also want to give this new agent a try even if you haven't used OpenTelemetry (with Sentry) before. It offers support for many more libraries and frameworks, improving on our trace propagation,
Scopes(used to beHub) propagation as well as performance instrumentation (i.e. more spans). - If you are using a framework we did not support before and currently resort to manual instrumentation, please give the agent a try. See here for a list of supported libraries, frameworks and application servers.
- Please see Java SDK docs for more details on how to set up the agent. Please make sure to select the correct SDK from the dropdown on the left side of the docs.
- What's new about the Agent
- When the OpenTelemetry Agent is used, Sentry API creates OpenTelemetry spans under the hood, handing back a wrapper object which bridges the gap between traditional Sentry API and OpenTelemetry. We might be replacing some of the Sentry performance API in the future.
- This is achieved by configuring the SDK to use
OtelSpanFactoryinstead ofDefaultSpanFactorywhich is done automatically by the auto init of the Java Agent.
- This is achieved by configuring the SDK to use
- OpenTelemetry spans are now only turned into Sentry spans when they are finished so they can be sent to the Sentry server.
- Now registers an OpenTelemetry
Samplerwhich uses Sentry sampling configuration - Other Performance integrations automatically stop creating spans to avoid duplicate spans
- The Sentry SDK now makes use of OpenTelemetry
Contextfor storing SentryScopes(which is similar to what used to be calledHub) and thus relies on OpenTelemetry forContextpropagation. - Classes used for the previous version of our OpenTelemetry support have been deprecated but can still be used manually. We're not planning to keep the old agent around in favor of less complexity in the SDK.
- When the OpenTelemetry Agent is used, Sentry API creates OpenTelemetry spans under the hood, handing back a wrapper object which bridges the gap between traditional Sentry API and OpenTelemetry. We might be replacing some of the Sentry performance API in the future.
- You may also want to give this new agent a try even if you haven't used OpenTelemetry (with Sentry) before. It offers support for many more libraries and frameworks, improving on our trace propagation,
- Add
sentry-opentelemetry-agentless-springmodule (#4000)- This module can be added as a dependency when using Sentry with OpenTelemetry and Spring Boot but don't want to use our Agent. It takes care of configuring OpenTelemetry for use with Sentry.
- You may want to set
OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=noneenv vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.
- Add
sentry-opentelemetry-agentlessmodule (#3961)- This module can be added as a dependency when using Sentry with OpenTelemetry but don't want to use our Agent. It takes care of configuring OpenTelemetry for use with Sentry.
- To enable the auto configuration of it, please set
-Dotel.java.global-autoconfigure.enabled=trueon thejavacommand, when starting your application. - You may also want to set
OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=noneenv vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.
OpenTelemetryUtil.applyOpenTelemetryOptionsnow takes an enum instead of a boolean for its mode- Add
openTelemetryModeoption (#3994)- It defaults to
AUTOmeaning the SDK will figure out how to best configure itself for use with OpenTelemetry - Use of OpenTelemetry can also be disabled completely by setting it to
OFF(#3995)- In this case even if OpenTelemetry is present, the Sentry SDK will not use it
- Use
AGENTwhen usingsentry-opentelemetry-agent - Use
AGENTLESSwhen usingsentry-opentelemetry-agentless - Use
AGENTLESS_SPRINGwhen usingsentry-opentelemetry-agentless-spring
- It defaults to
- Add
ignoredTransactionsoption to filter out transactions by name (#3871)- can be used via ENV vars, e.g.
SENTRY_IGNORED_TRANSACTIONS=POST /person/,GET /pers.* - can also be set in options directly, e.g.
options.setIgnoredTransactions(...) - can also be set in
sentry.properties, e.g.ignored-transactions=POST /person/,GET /pers.* - can also be set in Spring config
application.properties, e.g.sentry.ignored-transactions=POST /person/,GET /pers.*
- can be used via ENV vars, e.g.
- Add
scopeBindingModetoSpanOptions(#4004)- This setting only affects the SDK when used with OpenTelemetry.
- Defaults to
AUTOmeaning the SDK will decide whether the span should be bound to the current scope. It will not bind transactions to scope usingAUTO, it will only bind spans where the parent span is on the current scope. ONsets the new span on the current scope.OFFdoes not set the new span on the scope.
- Add
ignoredSpanOriginsoption for ignoring spans coming from certain integrations- We pre-configure this to ignore Performance instrumentation for Spring and other integrations when using our OpenTelemetry Agent to avoid duplicate spans
- Support
graphql-javav22 via a new modulesentry-graphql-22(#3740)- If you are using
graphql-javav21 or earlier, you can use thesentry-graphqlmodule - For
graphql-javav22 and newer please use thesentry-graphql-22module
- If you are using
- We now provide a
SentryInstrumenterbean directly for Spring (Boot) if there is none yet instead of usingGraphQlSourceBuilderCustomizerto add the instrumentation (#3744)- It is now also possible to provide a bean of type
SentryGraphqlInstrumentation.BeforeSpanCallbackwhich is then used bySentryInstrumenter
- It is now also possible to provide a bean of type
- Add data fetching environment hint to breadcrumb for GraphQL (#3413) (#3431)
- Report exceptions returned by Throwable.getSuppressed() to Sentry as exception groups ([#3396] https://github.com/getsentry/sentry-java/pull/3396)
- Any suppressed exceptions are added to the issue details page in Sentry, the same way any cause is.
- We are planning to improve how we visualize suppressed exceptions. See https://github.com/getsentry/sentry-java/issues/4059
- Enable
ThreadLocalAccessorfor Spring Boot 3 WebFlux by default (#4023) - Allow passing
environmenttoCheckinUtils.withCheckIn(3889) - Add
globalHubModeto options (#3805)globalHubModeused to only be a param onSentry.init. To make it easier to be used in e.g. Desktop environments, we now additionally added it as an option on SentryOptions that can also be set viasentry.properties.- If both the param on
Sentry.initand the option are set, the option will win. By default the option is set tonullmeaning whatever is passed toSentry.inittakes effect.
- Lazy uuid generation for SentryId and SpanId (#3770)
- Faster generation of Sentry and Span IDs (#3818)
- Uses faster implementation to convert UUID to SentryID String
- Uses faster Random implementation to generate UUIDs
- Android 15: Add support for 16KB page sizes (#3851)
- See https://developer.android.com/guide/practices/page-sizes for more details
- Add init priority settings (#3674)
- You may now set
forceInit=true(force-initfor.propertiesfiles) to ensure a call to Sentry.init / SentryAndroid.init takes effect
- You may now set
- Add force init option to Android Manifest (#3675)
- Use
<meta-data android:name="io.sentry.force-init" android:value="true" />to ensure Sentry Android auto init is not easily overwritten
- Use
- Attach request body for
application/x-www-form-urlencodedrequests in Spring (#3731)- Previously request body was only attached for
application/jsonrequests
- Previously request body was only attached for
- Set breadcrumb level based on http status (#3771)
- Emit transaction.data inside contexts.trace.data (#3735)
- Also does not emit
transaction.datainextrasanymore
- Also does not emit
- Add a sample for showcasing Sentry with OpenTelemetry for Spring Boot 3 with our Java agent (
sentry-samples-spring-boot-jakarta-opentelemetry) (#3856) - Add a sample for showcasing Sentry with OpenTelemetry for Spring Boot 3 without our Java agent (
sentry-samples-spring-boot-jakarta-opentelemetry-noagent) (#3856) - Add a sample for showcasing Sentry with OpenTelemetry (
sentry-samples-console-opentelemetry-noagent) (#3856)
Fixes
- Fix incoming defer sampling decision
sentry-traceheader (#3942)- A
sentry-traceheader that only contains trace ID and span ID but no sampled flag (-1,-0suffix) means the receiving system can make its own sampling decision - When generating
sentry-traceheader fromPropagationContextwe now copy thesampledflag. - In
TransactionContext.fromPropagationContextwhen there is no parent sampling decision, keep the decisionnullso a new sampling decision is made instead of defaulting tofalse
- A
- Fix order of calling
closeon previous Sentry instance when re-initializing (#3750)- Previously some parts of Sentry were immediately closed after re-init that should have stayed open and some parts of the previous init were never closed
- All status codes below 400 are now mapped to
SpanStatus.OK(#3869) - Improve ignored check performance (#3992)
- Checking if a span origin, a transaction or a checkIn should be ignored is now faster
- Cache requests for Spring using Springs
ContentCachingRequestWrapperinstead of our own Wrapper to also cache parameters (#3641)- Previously only the body was cached which could lead to problems in the FilterChain as Request parameters were not available
- Close backpressure monitor on SDK shutdown (#3998)
- Due to the backpressure monitor rescheduling a task to run every 10s, it very likely caused shutdown to wait the full
shutdownTimeoutMillis(defaulting to 2s) instead of being able to terminate immediately
- Due to the backpressure monitor rescheduling a task to run every 10s, it very likely caused shutdown to wait the full
- Let OpenTelemetry auto instrumentation handle extracting and injecting tracing information if present (#3953)
- Our integrations no longer call
.continueTraceand also do not inject tracing headers if the integration has been added toignoredSpanOrigins
- Our integrations no longer call
- Fix testTag not working for Jetpack Compose user interaction tracking (#3878)
- Mark
DiskFlushNotificationhint flushed when rate limited (#3892)- Our
UncaughtExceptionHandlerIntegrationwaited for the full flush timeout duration (default 15s) when rate limited.
- Our
- Do not replace
opwith auto generated content for OpenTelemetry spans with span kindINTERNAL(#3906) - Add
enable-spotlightandspotlight-connection-urlto external options and check if spotlight is enabled when deciding whether to inspect an OpenTelemetry span for connecting to splotlight (#3709) - Trace context on
Contexts.setTracehas been marked@NotNull(#3721)- Setting it to
nullwould cause an exception. - Transactions are dropped if trace context is missing
- Setting it to
- Remove internal annotation on
SpanOptions(#3722) SentryLogbackInitializeris now public (#3723)- Parse and use
send-default-piiandmax-request-body-sizefromsentry.properties(#3534) TracesSampleris now only created once inSentryOptionsinstead of creating a new one for everyHub(which is nowScopes). This means we're now creating fewerSecureRandominstances.
Internal
Changes in pre-releases
These changes have been made during development of 8.0.0. You may skip this section. We just put it here for sake of completeness.
- Extract OpenTelemetry
URL_PATHspan attribute into description (#3933) - Replace OpenTelemetry
ContextStoragewrapper withContextStorageProvider(#3938)- The wrapper had to be put in place before any call to
ContextwhereasContextStorageProvideris automatically invoked at the correct time.
- The wrapper had to be put in place before any call to
- Send
otel.kindto Sentry (#3907) - Spring Boot now automatically detects if OpenTelemetry is available and makes use of it (#3846)
- This is only enabled if there is no OpenTelemetry agent available
- We prefer to use the OpenTelemetry agent as it offers more auto instrumentation
- In some cases the OpenTelemetry agent cannot be used, please see https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/ for more details on when to prefer the Agent and when the Spring Boot starter makes more sense.
- In this mode the SDK makes use of the
OpenTelemetrybean that is created byopentelemetry-spring-boot-starterinstead ofGlobalOpenTelemetry
- Spring Boot now automatically detects our OpenTelemetry agent if its auto init is disabled (#3848)
- This means Spring Boot config mechanisms can now be combined with our OpenTelemetry agent
- The
sentry-opentelemetry-extramodule has been removed again, most classes have been moved tosentry-opentelemetry-bootstrapwhich is loaded into the bootstrap classloader (i.e.null) when our Java agent is used. The rest has been moved intosentry-opentelemetry-agentcustomizationand is loaded into the agent classloader when our Java agent is used. - The
sentry-opentelemetry-bootstrapandsentry-opentelemetry-agentcustomizationmodules can be used without the agent as well, in which case all classes are loaded into the application classloader. Check out oursentry-samples-spring-boot-jakarta-opentelemetry-noagentsample. - In this mode the SDK makes use of
GlobalOpenTelemetry
Automatically set span factory based on presence of OpenTelemetry (#3858)
SentrySpanFactoryHolderhas been removed as it is no longer required.
Replace deprecated
SimpleInstrumentationwithSimplePerformantInstrumentationfor graphql 22 (#3974)We now hold a strong reference to the underlying OpenTelemetry span when it is created through Sentry API (#3997)
- This keeps it from being garbage collected too early
Defer sampling decision by setting
sampledtonullinPropagationContextwhen using OpenTelemetry in case of an incoming defer samplingsentry-traceheader. (#3945)Build
PropagationContextfromSamplingDecisionmade bySentrySamplerinstead of parsing headers and potentially ignoring a sampling decision in case asentry-traceheader comes in with deferred sampling decision. (#3947)The Sentry OpenTelemetry Java agent now makes sure Sentry
Scopesstorage is initialized even if the agents auto init is disabled (#3848)- This is required for all integrations to work together with our OpenTelemetry Java agent if its auto init has been disabled and the SDKs init should be used instead.
Fix
startChildfor span that is not in current OpenTelemetryContext(#3862)- Starting a child span from a transaction that wasn't in the current
Contextlead to multiple transactions being created (one for the transaction and another per span created).
- Starting a child span from a transaction that wasn't in the current
Add
auto.graphql.graphql22to ignored span origins when using OpenTelemetry (#3828)Use OpenTelemetry span name as fallback for transaction name (#3557)
- In certain cases we were sending transactions as "
" when using OpenTelemetry
- In certain cases we were sending transactions as "
Add OpenTelemetry span data to Sentry span (#3593)
No longer selectively copy OpenTelemetry attributes to Sentry spans / transactions
data(#3663)Remove
PROCESS_COMMAND_ARGS(process.command_args) OpenTelemetry span attribute as it can be very large (#3664)Use RECORD_ONLY sampling decision if performance is disabled (#3659)
- Also fix check whether Performance is enabled when making a sampling decision in the OpenTelemetry sampler
Sentry OpenTelemetry Java Agent now sets Instrumenter to SENTRY (used to be OTEL) (#3697)
Set span origin in
ActivityLifecycleIntegrationon span options instead of after creating the span / transaction (#3702)- This allows spans to be filtered by span origin on creation
Honor ignored span origins in
SentryTracer.startChild(#3704)Use span id of remote parent (#3548)
- Traces were broken because on an incoming request, OtelSentrySpanProcessor did not set the parentSpanId on the span correctly. Traces were not referencing the actual parent span but some other (random) span ID which the server doesn't know.
Attach active span to scope when using OpenTelemetry (#3549)
- Errors weren't linked to traces correctly due to parts of the SDK not knowing the current span
Record dropped spans in client report when sampling out OpenTelemetry spans (#3552)
Retrieve the correct current span from
Scope/Scopeswhen using OpenTelemetry (#3554)Support spans that are split into multiple batches (#3539)
- When spans belonging to a single transaction were split into multiple batches for SpanExporter, we did not add all spans because the isSpanTooOld check wasn't inverted.
Partially fix bootstrap class loading (#3543)
- There was a problem with two separate Sentry
Scopesbeing active inside each OpenTelemetryContextdue to using context keys from more than one class loader.
- There was a problem with two separate Sentry
The Spring Boot 3 WebFlux sample now uses our GraphQL v22 integration (#3828)
Do not ignore certain span origins for OpenTelemetry without agent (#3856)
span.startChildnow uses.makeCurrent()by default (#3544)- This caused an issue where the span tree wasn't correct because some spans were not added to their direct parent
Do not set the exception group marker when there is a suppressed exception (#4056)
- Due to how grouping works in Sentry currently sometimes the suppressed exception is treated as the main exception. This change ensures we keep using the main exception and not change how grouping works.
- As a consequence the list of exceptions in the group on top of an issue is no longer shown in Sentry UI.
- We are planning to improve this in the future but opted for this fix first.
Dependencies
- Bump Native SDK from v0.7.0 to v0.7.17 (#3441) (#3851) (#3914) (#4003)
- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 (#3668) (#3935)
Migration Guide / Deprecations
Please take a look at our migration guide in docs.
Hubhas been deprecated, we're replacing the following:IHubhas been replaced byIScopes, however you should be able to simply passIHubinstances to code expectingIScopes, allowing for an easier migration.HubAdapter.getInstance()has been replaced byScopesAdapter.getInstance()- The
.clone()method onIHub/IScopeshas been deprecated, please use.pushScope()or.pushIsolationScope()instead - Some internal methods like
.getCurrentHub()and.setCurrentHub()have also been replaced.
Sentry.popScopehas been replaced by calling.close()on the token returned bySentry.pushScope()andSentry.pushIsolationScope(). The token can also be used in atryblock like this:
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushScope()) {
// this block has its separate current scope
}
as well as:
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushIsolationScope()) {
// this block has its separate isolation scope
}
- Classes used by our previous OpenTelemetry integration have been deprecated (SentrySpanProcessor, SentryPropagator, OpenTelemetryLinkErrorEventProcessor). Please take a look at docs on how to setup OpenTelemetry in v8.
You may also use LifecycleHelper.close(token), e.g. in case you need to pass the token around for closing later.
Changes from rc.4
If you have been using 8.0.0-rc.4 of the Java SDK, here's the new changes that have been included in the 8.0.0 release:
- Make
SentryClientconstructor public (#4045) - The user ip-address is now only set to
"{{auto}}"if sendDefaultPii is enabled (#4072)- This change gives you control over IP address collection directly on the client
- Do not set the exception group marker when there is a suppressed exception (#4056)
- Due to how grouping works in Sentry currently sometimes the suppressed exception is treated as the main exception. This change ensures we keep using the main exception and not change how grouping works.
- As a consequence the list of exceptions in the group on top of an issue is no longer shown in Sentry UI.
- We are planning to improve this in the future but opted for this fix first.
- Fix swallow NDK loadLibrary errors (#4082)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.21.0-beta.1
Fixes
- Do not instrument File I/O operations if tracing is disabled (#4051)
- Do not instrument User Interaction multiple times (#4051)
- Speed up view traversal to find touched target in
UserInteractionIntegration(#4051) - Reduce IPC/Binder calls performed by the SDK (#4058)
Behavioural Changes
- Reduce the number of broadcasts the SDK is subscribed for (#4052)
- Drop
TempSensorBreadcrumbsIntegration - Drop
PhoneStateBreadcrumbsIntegration - Reduce number of broadcasts in
SystemEventsBreadcrumbsIntegration
- Drop
Current list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the SystemEventsBreadcrumbsIntegration as follows:
kotlin
SentryAndroid.init(context) { options ->
options.integrations.removeAll { it is SystemEventsBreadcrumbsIntegration }
options.integrations.add(SystemEventsBreadcrumbsIntegration(context, SystemEventsBreadcrumbsIntegration.getDefaultActions() + listOf(/* your custom actions */)))
}
If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.20.1
Behavioural Changes
- The user ip-address is now only set to
"{{auto}}"if sendDefaultPii is enabled (#4071)- This change gives you control over IP address collection directly on the client
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-rc.4
Features
- Enable
ThreadLocalAccessorfor Spring Boot 3 WebFlux by default (#4023)
Internal
- Warm starts cleanup (#3954)
Dependencies
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.20.0
Features
- Session Replay GA (#4017)
To enable Replay use the sessionReplay.sessionSampleRate or sessionReplay.onErrorSampleRate options.
```kotlin import io.sentry.SentryReplayOptions import io.sentry.android.core.SentryAndroid
SentryAndroid.init(context) { options ->
options.sessionReplay.sessionSampleRate = 1.0
options.sessionReplay.onErrorSampleRate = 1.0
// To change default redaction behavior (defaults to true)
options.sessionReplay.redactAllImages = true
options.sessionReplay.redactAllText = true
// To change quality of the recording (defaults to MEDIUM)
options.sessionReplay.quality = SentryReplayOptions.SentryReplayQuality.MEDIUM // (LOW|MEDIUM|HIGH)
} ```
To learn more about Session Replay, visit the documentation page: https://docs.sentry.io/platforms/android/session-replay/
Fixes
- Fix warm start detection (#3937)
- Session Replay: Reduce memory allocations, disk space consumption, and payload size (#4016)
- Session Replay: Do not try to encode corrupted frames multiple times (#4016)
Internal
- Session Replay: Allow overriding
SdkVersionfor replay events (#4014) - Session Replay: Send replay options as tags (#4015)
Breaking changes
- Session Replay options were moved from under
experimentalto the mainoptionsobject (#4017)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.19.1
Fixes
- Change TTFD timeout to 25 seconds (#3984)
- Session Replay: Fix memory leak when masking Compose screens (#3985)
- Session Replay: Fix potential ANRs in
GestureRecorder(#4001)
Internal
- Session Replay: Flutter improvements (#4007)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-rc.3
Features
- Add
sentry-opentelemetry-agentless-springmodule (#4000)- This module can be added as a dependency when using Sentry with OpenTelemetry and Spring Boot but don't want to use our Agent. It takes care of configuring OpenTelemetry for use with Sentry.
- You may want to set
OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=noneenv vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.
- Add
sentry-opentelemetry-agentlessmodule (#3961)- This module can be added as a dependency when using Sentry with OpenTelemetry but don't want to use our Agent. It takes care of configuring OpenTelemetry for use with Sentry.
- To enable the auto configuration of it, please set
-Dotel.java.global-autoconfigure.enabled=trueon thejavacommand, when starting your application. - You may also want to set
OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=noneenv vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.
OpenTelemetryUtil.applyOpenTelemetryOptionsnow takes an enum instead of a boolean for its mode- Add
openTelemetryModeoption (#3994)- It defaults to
AUTOmeaning the SDK will figure out how to best configure itself for use with OpenTelemetry - Use of OpenTelemetry can also be disabled completely by setting it to
OFF(#3995)- In this case even if OpenTelemetry is present, the Sentry SDK will not use it
- Use
AGENTwhen usingsentry-opentelemetry-agent - Use
AGENTLESSwhen usingsentry-opentelemetry-agentless - Use
AGENTLESS_SPRINGwhen usingsentry-opentelemetry-agentless-spring
- It defaults to
- Add
scopeBindingModetoSpanOptions(#4004)- This setting only affects the SDK when used with OpenTelemetry.
- Defaults to
AUTOmeaning the SDK will decide whether the span should be bound to the current scope. It will not bind transactions to scope usingAUTO, it will only bind spans where the parent span is on the current scope. ONsets the new span on the current scope.OFFdoes not set the new span on the scope.
Fixes
- Replace deprecated
SimpleInstrumentationwithSimplePerformantInstrumentationfor graphql 22 (#3974) - Cache requests for Spring using Springs
ContentCachingRequestWrapperinstead of our own Wrapper to also cache parameters (#3641)- Previously only the body was cached which could lead to problems in the FilterChain as Request parameters were not available
- We now hold a strong reference to the underlying OpenTelemetry span when it is created through Sentry API (#3997)
- This keeps it from being garbage collected too early
- Close backpressure monitor on SDK shutdown (#3998)
- Due to the backpressure monitor rescheduling a task to run every 10s, it very likely caused shutdown to wait the full
shutdownTimeoutMillis(defaulting to 2s) instead of being able to terminate immediately
- Due to the backpressure monitor rescheduling a task to run every 10s, it very likely caused shutdown to wait the full
- Improve ignored check performance (#3992)
- Checking if a span origin, a transaction or a checkIn should be ignored is now faster
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.19.0
Fixes
- Session Replay: fix various crashes and issues (#3970)
- Fix
IndexOutOfBoundsExceptionwhen tracking window changes - Fix
IllegalStateExceptionwhen adding/removing draw listener for a dead view - Fix
ConcurrentModificationExceptionwhen registering window listeners and stoppingWindowRecorder/GestureRecorder
- Fix
- Add support for setting sentry-native handler_strategy (#3671)
Dependencies
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-rc.2
Fixes
- Fix incoming defer sampling decision
sentry-traceheader (#3942)- A
sentry-traceheader that only contains trace ID and span ID but no sampled flag (-1,-0suffix) means the receiving system can make its own sampling decision - When generating
sentry-traceheader fromPropagationContextwe now copy thesampledflag. - In
TransactionContext.fromPropagationContextwhen there is no parent sampling decision, keep the decisionnullso a new sampling decision is made instead of defaulting tofalse
- A
- Defer sampling decision by setting
sampledtonullinPropagationContextwhen using OpenTelemetry in case of an incoming defer samplingsentry-traceheader. (#3945) - Build
PropagationContextfromSamplingDecisionmade bySentrySamplerinstead of parsing headers and potentially ignoring a sampling decision in case asentry-traceheader comes in with deferred sampling decision. (#3947) - Let OpenTelemetry handle extracting and injecting tracing information (#3953)
- Our integrations no longer call
.continueTraceand also do not inject tracing headers if the integration has been added toignoredSpanOrigins
- Our integrations no longer call
- Changes up to
7.18.1have been merged and are now included as well
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-rc.1
Features
- Extract OpenTelemetry
URL_PATHspan attribute into description (#3933) - Replace OpenTelemetry
ContextStoragewrapper withContextStorageProvider(#3938)- The wrapper had to be put in place before any call to
ContextwhereasContextStorageProvideris automatically invoked at the correct time.
- The wrapper had to be put in place before any call to
Dependencies
- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 (#3935)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.18.1
Fixes
- Fix testTag not working for Jetpack Compose user interaction tracking (#3878)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-beta.3
Features
- Send
otel.kindto Sentry (#3907) - Allow passing
environmenttoCheckinUtils.withCheckIn(3889) - Changes up to
7.18.0have been merged and are now included as well
Fixes
- Mark
DiskFlushNotificationhint flushed when rate limited (#3892)- Our
UncaughtExceptionHandlerIntegrationwaited for the full flush timeout duration (default 15s) when rate limited.
- Our
- Do not replace
opwith auto generated content for OpenTelemetry spans with span kindINTERNAL(#3906)
Behavioural Changes
- Send file name and path only if isSendDefaultPii is true (#3919)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.18.0
Features
- Android 15: Add support for 16KB page sizes (#3620)
- See https://developer.android.com/guide/practices/page-sizes for more details
- Session Replay: Add
beforeSendReplaycallback (#3855) - Session Replay: Add support for masking/unmasking view containers (#3881)
Fixes
- Avoid collecting normal frames (#3782)
- Ensure android initialization process continues even if options configuration block throws an exception (#3887)
- Do not report parsing ANR error when there are no threads (#3888)
- This should significantly reduce the number of events with message "Sentry Android SDK failed to parse system thread dump..." reported
- Session Replay: Disable replay in session mode when rate limit is active (#3854)
Dependencies
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-beta.2
Breaking Changes
- Use String instead of UUID for SessionId (#3834)
- The
Sessionconstructor now takes aStringinstead of aUUIDfor thesessionIdparameter. Session.getSessionId()now returns aStringinstead of aUUID.
- The
- The Android minSdk level for all Android modules is now 21 (#3852)
- The minSdk level for sentry-android-ndk changed from 19 to 21 (#3851)
- All status codes below 400 are now mapped to
SpanStatus.OK(#3869)
Features
- Spring Boot now automatically detects if OpenTelemetry is available and makes use of it (#3846)
- This is only enabled if there is no OpenTelemetry agent available
- We prefer to use the OpenTelemetry agent as it offers more auto instrumentation
- In some cases the OpenTelemetry agent cannot be used, please see https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/ for more details on when to prefer the Agent and when the Spring Boot starter makes more sense.
- In this mode the SDK makes use of the
OpenTelemetrybean that is created byopentelemetry-spring-boot-starterinstead ofGlobalOpenTelemetry
- Spring Boot now automatically detects our OpenTelemetry agent if its auto init is disabled (#3848)
- This means Spring Boot config mechanisms can now be combined with our OpenTelemetry agent
- The
sentry-opentelemetry-extramodule has been removed again, most classes have been moved tosentry-opentelemetry-bootstrapwhich is loaded into the bootstrap classloader (i.e.null) when our Java agent is used. The rest has been moved intosentry-opentelemetry-agentcustomizationand is loaded into the agent classloader when our Java agent is used. - The
sentry-opentelemetry-bootstrapandsentry-opentelemetry-agentcustomizationmodules can be used without the agent as well, in which case all classes are loaded into the application classloader. Check out oursentry-samples-spring-boot-jakarta-opentelemetry-noagentsample. - In this mode the SDK makes use of
GlobalOpenTelemetry
- Automatically set span factory based on presence of OpenTelemetry (#3858)
SentrySpanFactoryHolderhas been removed as it is no longer required.
- Add
ignoredTransactionsoption to filter out transactions by name (#3871)- can be used via ENV vars, e.g.
SENTRY_IGNORED_TRANSACTIONS=POST /person/,GET /pers.* - can also be set in options directly, e.g.
options.setIgnoredTransactions(...) - can also be set in
sentry.properties, e.g.ignored-transactions=POST /person/,GET /pers.* - can also be set in Spring config
application.properties, e.g.sentry.ignored-transactions=POST /person/,GET /pers.*
- can be used via ENV vars, e.g.
- Add a sample for showcasing Sentry with OpenTelemetry for Spring Boot 3 with our Java agent (
sentry-samples-spring-boot-jakarta-opentelemetry) (#3856) - Add a sample for showcasing Sentry with OpenTelemetry for Spring Boot 3 without our Java agent (
sentry-samples-spring-boot-jakarta-opentelemetry-noagent) (#3856) - Add a sample for showcasing Sentry with OpenTelemetry (
sentry-samples-console-opentelemetry-noagent) (#3856) - Add
globalHubModeto options (#3805)globalHubModeused to only be a param onSentry.init. To make it easier to be used in e.g. Desktop environments, we now additionally added it as an option on SentryOptions that can also be set viasentry.properties.- If both the param on
Sentry.initand the option are set, the option will win. By default the option is set tonullmeaning whatever is passed toSentry.inittakes effect.
- Lazy uuid generation for SentryId and SpanId (#3770)
- Faster generation of Sentry and Span IDs (#3818)
- Uses faster implementation to convert UUID to SentryID String
- Uses faster Random implementation to generate UUIDs
- Android 15: Add support for 16KB page sizes (#3851)
- See https://developer.android.com/guide/practices/page-sizes for more details
Fixes
- The Sentry OpenTelemetry Java agent now makes sure Sentry
Scopesstorage is initialized even if the agents auto init is disabled (#3848)- This is required for all integrations to work together with our OpenTelemetry Java agent if its auto init has been disabled and the SDKs init should be used instead.
- Do not ignore certain span origins for OpenTelemetry without agent (#3856)
- Fix
startChildfor span that is not in current OpenTelemetryContext(#3862)- Starting a child span from a transaction that wasn't in the current
Contextlead to multiple transactions being created (one for the transaction and another per span created).
- Starting a child span from a transaction that wasn't in the current
- Add
auto.graphql.graphql22to ignored span origins when using OpenTelemetry (#3828) - The Spring Boot 3 WebFlux sample now uses our GraphQL v22 integration (#3828)
- All status codes below 400 are now mapped to
SpanStatus.OK(#3869)
Dependencies
Behavioural Changes
- (Android) Enable Performance V2 by default (#3824)
- With this change cold app start spans will include spans for ContentProviders, Application and Activity load.
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.17.0
Features
- Add meta option to set the maximum amount of breadcrumbs to be logged. (#3836)
- Use a separate
Randominstance per thread to improve SDK performance (#3835)
Fixes
- Using MaxBreadcrumb with value 0 no longer crashes. (#3836)
- Accept manifest integer values when requiring floating values (#3823)
- Fix standalone tomcat jndi issue (#3873)
- Using Sentry Spring Boot on a standalone tomcat caused the following error:
- Failed to bind properties under 'sentry.parsed-dsn' to io.sentry.Dsn
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.17.0-alpha.1
Features
- Android 15: Add support for 16KB page sizes (#3620)
- See https://developer.android.com/guide/practices/page-sizes for more details
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.16.0
Features
- Add meta option to attach ANR thread dumps (#3791)
Fixes
- Cache parsed Dsn (#3796)
- fix invalid profiles when the transaction name is empty (#3747)
- Deprecate
enableTracingoption (#3777) - Vendor
java.util.Randomand replacejava.security.SecureRandomusages (#3783) - Fix potential ANRs due to NDK scope sync (#3754)
- Fix potential ANRs due to NDK System.loadLibrary calls (#3670)
- Fix slow
Logcalls on app startup (#3793) - Fix slow Integration name parsing (#3794)
- Session Replay: Reduce startup and capture overhead (#3799)
- Load lazy fields on init in the background (#3803)
- Replace setOf with HashSet.add (#3801)
Breaking changes
- The method
addIntegrationToSdkVersion(Ljava/lang/Class;)Vhas been removed from the core (io.sentry:sentry) package. Please make sure all of the packages (e.g.io.sentry:sentry-android-core,io.sentry:sentry-android-fragment,io.sentry:sentry-okhttpand others) are all aligned and using the same version to prevent theNoSuchMethodErrorexception.
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.16.0-alpha.1
Features
- Add meta option to attach ANR thread dumps (#3791)
Fixes
- Cache parsed Dsn (#3796)
- fix invalid profiles when the transaction name is empty (#3747)
- Deprecate
enableTracingoption (#3777) - Vendor
java.util.Randomand replacejava.security.SecureRandomusages (#3783) - Fix potential ANRs due to NDK scope sync (#3754)
- Fix potential ANRs due to NDK System.loadLibrary calls (#3670)
- Fix slow
Logcalls on app startup (#3793) - Fix slow Integration name parsing (#3794)
- Session Replay: Reduce startup and capture overhead (#3799)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 8.0.0-beta.1
Breaking Changes
- Throw IllegalArgumentException when calling Sentry.init on Android (#3596)
- Metrics have been removed from the SDK (#3774)
- Metrics will return but we don't know in what exact form yet
enableTracingoption (a.k.aenable-tracing) has been removed from the SDK (#3776)- Please set
tracesSampleRateto a value >= 0.0 for enabling performance instead. The default value isnullwhich means performance is disabled.
- Please set
- Change OkHttp sub-spans to span attributes (#3556)
- This will reduce the number of spans created by the SDK
- Replace
synchronizedmethods and blocks withReentrantLock(AutoClosableReentrantLock) (#3715)- If you are subclassing any Sentry classes, please check if the parent class used
synchronizedbefore. Please make sure to use the same lock object as the parent class in that case.
- If you are subclassing any Sentry classes, please check if the parent class used
traceOriginsoption (io.sentry.traces.tracing-originsin manifest) has been removed, please usetracePropagationTargets(io.sentry.traces.trace-propagation-targetsin manifest`) instead (#3780)profilingEnabledoption (io.sentry.traces.profiling.enablein manifest) has been removed, please useprofilesSampleRate(io.sentry.traces.profiling.sample-rateinstead) instead (#3780)shutdownTimeoutoption has been removed, please useshutdownTimeoutMillisinstead (#3780)profilingTracesIntervalMillisoption for Android has been removed (#3780)io.sentry.session-tracking.enablemanifest option has been removed (#3780)Sentry.traceHeaders()method has been removed, please useSentry.getTraceparent()instead (#3718)Sentry.reportFullDisplayed()method has been removed, please useSentry.reportFullyDisplayed()instead (#3717)User.otherhas been removed, please usedatainstead (#3780)SdkVersion.getIntegrations()has been removed, please usegetIntegrationSetinstead (#3780)SdkVersion.getPackages()has been removed, please usegetPackageSet()instead (#3780)Device.languagehas been removed, please uselocaleinstead (#3780)TraceContext.userandTraceContextUserclass have been removed, please useuserIdonTraceContextinstead (#3780)TransactionContext.fromSentryTrace()has been removed, please useSentry.continueTrace()instead (#3780)SentryDataFetcherExceptionHandlerhas been removed, please useSentryGenericDataFetcherExceptionHandlerin combination withSentryInstrumentationinstead (#3780)- One of the
AndroidTransactionProfilerconstructors has been removed, please use a different one (#3780)
Features
- Add init priority settings (#3674)
- You may now set
forceInit=true(force-initfor.propertiesfiles) to ensure a call to Sentry.init / SentryAndroid.init takes effect
- You may now set
- Add force init option to Android Manifest (#3675)
- Use
<meta-data android:name="io.sentry.force-init" android:value="true" />to ensure Sentry Android auto init is not easily overwritten
- Use
- Attach request body for
application/x-www-form-urlencodedrequests in Spring (#3731)- Previously request body was only attached for
application/jsonrequests
- Previously request body was only attached for
- Set breadcrumb level based on http status (#3771)
- Support
graphql-javav22 via a new modulesentry-graphql-22(#3740)- If you are using
graphql-javav21 or earlier, you can use thesentry-graphqlmodule - For
graphql-javav22 and newer please use thesentry-graphql-22module
- If you are using
- We now provide a
SentryInstrumenterbean directly for Spring (Boot) if there is none yet instead of usingGraphQlSourceBuilderCustomizerto add the instrumentation (#3744)- It is now also possible to provide a bean of type
SentryGraphqlInstrumentation.BeforeSpanCallbackwhich is then used bySentryInstrumenter
- It is now also possible to provide a bean of type
- Emit transaction.data inside contexts.trace.data (#3735)
- Also does not emit
transaction.datainexrasanymore
- Also does not emit
Fixes
- Use OpenTelemetry span name as fallback for transaction name (#3557)
- In certain cases we were sending transactions as "
" when using OpenTelemetry
- In certain cases we were sending transactions as "
- Add OpenTelemetry span data to Sentry span (#3593)
- No longer selectively copy OpenTelemetry attributes to Sentry spans / transactions
data(#3663) - Remove
PROCESS_COMMAND_ARGS(process.command_args) OpenTelemetry span attribute as it can be very large (#3664) - Use RECORD_ONLY sampling decision if performance is disabled (#3659)
- Also fix check whether Performance is enabled when making a sampling decision in the OpenTelemetry sampler
- Sentry OpenTelemetry Java Agent now sets Instrumenter to SENTRY (used to be OTEL) (#3697)
- Set span origin in
ActivityLifecycleIntegrationon span options instead of after creating the span / transaction (#3702)- This allows spans to be filtered by span origin on creation
- Honor ignored span origins in
SentryTracer.startChild(#3704) - Add
enable-spotlightandspotlight-connection-urlto external options and check if spotlight is enabled when deciding whether to inspect an OpenTelemetry span for connecting to splotlight (#3709) - Trace context on
Contexts.setTracehas been marked@NotNull(#3721)- Setting it to
nullwould cause an exception. - Transactions are dropped if trace context is missing
- Setting it to
- Remove internal annotation on
SpanOptions(#3722) SentryLogbackInitializeris now public (#3723)- Fix order of calling
closeon previous Sentry instance when re-initializing (#3750)- Previously some parts of Sentry were immediately closed after re-init that should have stayed open and some parts of the previous init were never closed
Behavioural Changes
- (Android) Replace thread id with kernel thread id in span data (#3706)
Dependencies
- Bump OpenTelemetry to 1.41.0, OpenTelemetry Java Agent to 2.7.0 and Semantic Conventions to 1.25.0 (#3668)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.15.0
Features
- Add support for
feedbackenvelope header item type (#3687) - Add breadcrumb.origin field (#3727)
- Session Replay: Add options to selectively mask/unmask views captured in replay. The following options are available: (#3689)
android:tag="sentry-mask|sentry-unmask"in XML orview.setTag("sentry-mask|sentry-unmask")in code tags- if you already have a tag set for a view, you can set a tag by id:
<tag android:id="@id/sentry_privacy" android:value="mask|unmask"/>in XML orview.setTag(io.sentry.android.replay.R.id.sentry_privacy, "mask|unmask")in code
- if you already have a tag set for a view, you can set a tag by id:
view.sentryReplayMask()orview.sentryReplayUnmask()extension functions- mask/unmask
Views of a certain type by adding fully-qualified classname to one of the listsoptions.experimental.sessionReplay.addMaskViewClass()oroptions.experimental.sessionReplay.addUnmaskViewClass(). Note, that all of the view subclasses/subtypes will be masked/unmasked as well- For example, (this is already a default behavior) to mask all
TextViews and their subclasses (RadioButton,EditText, etc.):options.experimental.sessionReplay.addMaskViewClass("android.widget.TextView") - If you're using code obfuscation, adjust your proguard-rules accordingly, so your custom view class name is not minified
- For example, (this is already a default behavior) to mask all
- Session Replay: Support Jetpack Compose masking (#3739)
- To selectively mask/unmask Composables, use
Modifier.sentryReplayMask()andModifier.sentryReplayUnmask()modifiers
- To selectively mask/unmask Composables, use
- Session Replay: Mask
WebView,VideoViewandandroidx.media3.ui.PlayerViewby default (#3775)
Fixes
- Avoid stopping appStartProfiler after application creation (#3630)
- Session Replay: Correctly detect dominant color for
TextViews with Spans (#3682) - Fix ensure Application Context is used even when SDK is initialized via Activity Context (#3669)
- Fix potential ANRs due to
Calendar.getInstanceusage in Breadcrumbs constructor (#3736) - Fix potential ANRs due to default integrations (#3778)
- Lazily initialize heavy
SentryOptionsmembers to avoid ANRs on app start (#3749)
Breaking changes:
options.experimental.sessionReplay.errorSampleRatewas renamed tooptions.experimental.sessionReplay.onErrorSampleRate(#3637)- Manifest option
io.sentry.session-replay.error-sample-ratewas renamed toio.sentry.session-replay.on-error-sample-rate(#3637) - Change
redactAllTextandredactAllImagestomaskAllTextandmaskAllImages(#3741)
- Kotlin
Published by getsentry-bot over 1 year ago
https://github.com/getsentry/sentry-java - 7.15.0-alpha.1
Features
- Add support for setting sentry-native handler_strategy (#3671)
Dependencies
- Bump
sentry-nativeSDK tod11359bof feat/inprochandlerstrategy- See the following issue for more details: https://github.com/getsentry/sentry-native/issues/1026
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.14.0 (Stable)
Features
- Session Replay: Gesture/touch support for Flutter (#3623)
Fixes
- Fix app start spans missing from Pixel devices (#3634)
- Avoid ArrayIndexOutOfBoundsException on Android cpu data collection (#3598)
- Fix lazy select queries instrumentation (#3604)
- Session Replay: buffer mode improvements (#3622)
- Align next segment timestamp with the end of the buffered segment when converting from buffer mode to session mode
- Persist
bufferreplay type for the entire replay when converting from buffer mode to session mode - Properly store screen names for
buffermode
- Session Replay: fix various crashes and issues (#3628)
- Fix video not being encoded on Pixel devices
- Fix SIGABRT native crashes on Xiaomi devices when encoding a video
- Fix
RejectedExecutionExceptionwhen redacting a screenshot - Fix
FileNotFoundExceptionwhen persisting segment values
Chores
- Introduce
ReplayShadowMediaCodecand refactor tests using custom encoder (#3612)
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.13.0
Features
- Session Replay: (#3565) (#3609)
- Capture remaining replay segment for ANRs on next app launch
- Capture remaining replay segment for unhandled crashes on next app launch
Fixes
- Session Replay: (#3565) (#3609)
- Fix stopping replay in
sessionmode at 1 hour deadline - Never encode full frames for a video segment, only do partial updates. This further reduces size of the replay segment
- Use propagation context when no active transaction for ANRs
- Fix stopping replay in
Dependencies
- Bump Spring Boot to 3.3.2 (#3541)
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.12.1
Fixes
- Check app start spans time and ignore background app starts (#3550)
- This should eliminate long-lasting App Start transactions
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.12.0
Features
- Session Replay Public Beta (#3339)
To enable Replay use the sessionReplay.sessionSampleRate or sessionReplay.errorSampleRate experimental options.
```kotlin import io.sentry.SentryReplayOptions import io.sentry.android.core.SentryAndroid
SentryAndroid.init(context) { options ->
// Currently under experimental options:
options.experimental.sessionReplay.sessionSampleRate = 1.0
options.experimental.sessionReplay.errorSampleRate = 1.0
// To change default redaction behavior (defaults to true)
options.experimental.sessionReplay.redactAllImages = true
options.experimental.sessionReplay.redactAllText = true
// To change quality of the recording (defaults to MEDIUM)
options.experimental.sessionReplay.quality = SentryReplayOptions.SentryReplayQuality.MEDIUM // (LOW|MEDIUM|HIGH)
} ```
To learn more visit Sentry's Mobile Session Replay documentation page.
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.12.0-alpha.4
- Session Replay for Android (#3339)
We released our fifth 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
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 8.0.0-alpha.4
Fixes
- Removed user segment (#3512)
- Use span id of remote parent (#3548)
- Traces were broken because on an incoming request, OtelSentrySpanProcessor did not set the parentSpanId on the span correctly. Traces were not referencing the actual parent span but some other (random) span ID which the server doesn't know.
- Attach active span to scope when using OpenTelemetry (#3549)
- Errors weren't linked to traces correctly due to parts of the SDK not knowing the current span
- Record dropped spans in client report when sampling out OpenTelemetry spans (#3552)
- Retrieve the correct current span from
Scope/Scopeswhen using OpenTelemetry (#3554)
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.12.0-alpha.3
- Session Replay for Android (#3339)
We released our fourth 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
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 8.0.0-alpha.3
Breaking Changes
sentry-android-okhttphas been removed in favor ofsentry-okhttp, removing android dependency from the module (#3510)
Fixes
- Support spans that are split into multiple batches (#3539)
- When spans belonging to a single transaction were split into multiple batches for SpanExporter, we did not add all spans because the isSpanTooOld check wasn't inverted.
- Parse and use
send-default-piiandmax-request-body-sizefromsentry.properties(#3534) span.startChildnow uses.makeCurrent()by default (#3544)- This caused an issue where the span tree wasn't correct because some spans were not added to their direct parent
- Partially fix bootstrap class loading (#3543)
- There was a problem with two separate Sentry
Scopesbeing active inside each OpenTelemetryContextdue to using context keys from more than one class loader.
- There was a problem with two separate Sentry
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.11.0
Features
- Report dropped spans (#3528)
Fixes
- Fix duplicate session start for React Native (#3504)
- Move onFinishCallback before span or transaction is finished (#3459)
- Add timestamp when a profile starts (#3442)
- Move fragment auto span finish to onFragmentStarted (#3424)
- Remove profiling timeout logic and disable profiling on API 21 (#3478)
- Properly reset metric flush flag on metric emission (#3493)
- Use SecureRandom in favor of Random for Metrics (#3495)
- Fix UncaughtExceptionHandlerIntegration Memory Leak (#3398)
- Deprecated
User.segment. Use a custom tag or context instead. (#3511) - Fix duplicated http spans (#3526)
- When capturing unhandled hybrid exception session should be ended and new start if need (#3480)
Dependencies
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 8.0.0-alpha.2
Behavioural Changes
- (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native (#3189)
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
- Checkout the
sentry-samples/sentry-samples-androidexample on how to configure CMake and consumesentry.h
Features
- Our
sentry-opentelemetry-agenthas been completely reworked and now plays nicely with the rest of the Java SDK- You may also want to give this new agent a try even if you haven't used OpenTelemetry (with Sentry) before. It offers support for many more libraries and frameworks, improving on our trace propagation,
Scopes(used to beHub) propagation as well as performance instrumentation (i.e. more spans). - If you are using a framework we did not support before and currently resort to manual instrumentation, please give the agent a try. See here for a list of supported libraries, frameworks and application servers.
- NOTE: Not all features have been implemented yet for the OpenTelemetry agent. Features of note that are not working yet:
- Metrics
- Measurements
forceFinishon transactionscheduleFinishon transaction- see #3436 for a more up-to-date list of features we have (not) implemented
- Please see "Installing
sentry-opentelemetry-agent" for more details on how to set up the agent. - What's new about the Agent
- When the OpenTelemetry Agent is used, Sentry API creates OpenTelemetry spans under the hood, handing back a wrapper object which bridges the gap between traditional Sentry API and OpenTelemetry. We might be replacing some of the Sentry performance API in the future.
- This is achieved by configuring the SDK to use
OtelSpanFactoryinstead ofDefaultSpanFactorywhich is done automatically by the auto init of the Java Agent.
- This is achieved by configuring the SDK to use
- OpenTelemetry spans are now only turned into Sentry spans when they are finished so they can be sent to the Sentry server.
- Now registers an OpenTelemetry
Samplerwhich uses Sentry sampling configuration - Other Performance integrations automatically stop creating spans to avoid duplicate spans
- The Sentry SDK now makes use of OpenTelemetry
Contextfor storing SentryScopes(which is similar to what used to be calledHub) and thus relies on OpenTelemetry forContextpropagation. - Classes used for the previous version of our OpenTelemetry support have been deprecated but can still be used manually. We're not planning to keep the old agent around in favor of less complexity in the SDK.
- You may also want to give this new agent a try even if you haven't used OpenTelemetry (with Sentry) before. It offers support for many more libraries and frameworks, improving on our trace propagation,
- Add
ignoredSpanOriginsoption for ignoring spans coming from certain integrations- We pre-configure this to ignore Performance instrumentation for Spring and other integrations when using our OpenTelemetry Agent to avoid duplicate spans
- Add data fetching environment hint to breadcrumb for GraphQL (#3413) (#3431)
Fixes
TracesSampleris now only created once inSentryOptionsinstead of creating a new one for everyHub(which is nowScopes). This means we're now creating fewerSecureRandominstances.- Move onFinishCallback before span or transaction is finished (#3459)
- Add timestamp when a profile starts (#3442)
- Move fragment auto span finish to onFragmentStarted (#3424)
- Remove profiling timeout logic and disable profiling on API 21 (#3478)
- Properly reset metric flush flag on metric emission (#3493)
Migration Guide / Deprecations
- Classes used for the previous version of the Sentry OpenTelemetry Java Agent have been deprecated (
SentrySpanProcessor,SentryPropagator,OpenTelemetryLinkErrorEventProcessor) - Sentry OpenTelemetry Java Agent has been reworked and now allows you to manually create spans using Sentry API as well.
- Please see "Installing
sentry-opentelemetry-agent" for more details on how to set up the agent.
Installing sentry-opentelemetry-agent
Upgrading from a previous agent
If you've been using the previous version of sentry-opentelemetry-agent, simply replace the agent JAR with the latest release and start your application. That should be it.
New to the agent
If you've not been using OpenTelemetry before, you can add sentry-opentelemetry-agent to your setup by downloading the latest release and using it when starting up your application
- SENTRY_PROPERTIES_FILE=sentry.properties java -javaagent:sentry-opentelemetry-agent-x.x.x.jar -jar your-application.jar
- Please use sentry.properties or environment variables to configure the SDK as the agent is now in charge of initializing the SDK and options coming from things like logging integrations or our Spring Boot integration will not take effect.
- You may find the docs page useful. While we haven't updated it yet to reflect the changes described here, the section about using the agent with auto init should still be valid.
If you want to skip auto initialization of the SDK performed by the agent, please follow the steps above and set the environment variable SENTRY_AUTO_INIT to false then add the following to your Sentry.init:
Sentry.init(options -> {
options.setDsn("https://3d2ac63d6e1a4c6e9214443678f119a3@o87286.ingest.us.sentry.io/1801383");
OpenTelemetryUtil.applyOpenTelemetryOptions(options);
...
});
If you're using our Spring (Boot) integration with auto init, use the following:
@Bean
Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration() {
return (options) -> {
OpenTelemetryUtil.applyOpenTelemetryOptions(options);
};
}
Dependencies
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.11.0-alpha.2
- Session Replay for Android (#3339)
We released our third 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
Fixes
- Move onFinishCallback before span or transaction is finished (#3459)
- Add timestamp when a profile starts (#3442)
- Move fragment auto span finish to onFragmentStarted (#3424)
- Remove profiling timeout logic and disable profiling on API 21 (#3478)
- Properly reset metric flush flag on metric emission (#3493)
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 7.10.0
Features
- Publish Gradle module metadata (#3422)
Fixes
- Fix faulty
span.frame_delaycalculation for early app start spans (#3427) - Fix crash when installing
ShutdownHookIntegrationand the VM is shutting down (#3456)
- Kotlin
Published by getsentry-bot almost 2 years ago
https://github.com/getsentry/sentry-java - 8.0.0-alpha.1
Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
- New
Scopetypes have been introduced, see "Behavioural Changes" for more details. - Lifecycle tokens have been introduced to manage
Scopelifecycle, see "Behavioural Changes" for more details. Hubhas been replaced byScopes
Behavioural Changes
- We're introducing some new
Scopetypes in the SDK, allowing for better control over what data is attached where. Previously there was a stack of scopes that was pushed and popped. Instead we now fork scopes for a given lifecycle and then restore the previous scopes. SinceHubis gone, it is also never cloned anymore. Separation of data now happens through the different scope types while making it easier to manipulate exactly what you need without having to attach data at the right time to have it apply where wanted.- Global scope is attached to all events created by the SDK. It can also be modified before
Sentry.inithas been called. It can be manipulated usingSentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... }). - Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request. It can also be used for other isolation purposes. It can be manipulated using
Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... }). The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring@Asyncand more. - Current scope is forked often and data added to it is only added to events that are created while this scope is active. Data is also passed on to newly forked child scopes but not to parents.
- Global scope is attached to all events created by the SDK. It can also be modified before
Sentry.popScopehas been deprecated, please call.close()on the token returned bySentry.pushScopeinstead or use it in a way described in more detail in "Migration Guide".- We have chosen a default scope that is used for
Sentry.configureScope()as well as API likeSentry.setTag()- For Android the type defaults to
CURRENTscope - For Backend and other JVM applicatons it defaults to
ISOLATIONscope
- For Android the type defaults to
- Event processors on
Scopecan now be ordered by overriding thegetOrdermethod on implementations ofEventProcessor. NOTE: This order only applies to event processors onScopebut notSentryOptionsat the moment. Feel free to request this if you need it. Hubis deprecated in favor ofScopes, alongside someHubrelevant APIs. More details can be found in the "Migration Guide" section.
Breaking Changes
Contextsno longer extendsConcurrentHashMap, instead we offer a selected set of methods.
Migration Guide / Deprecations
Hubhas been deprecated, we're replacing the following:IHubhas been replaced byIScopes, however you should be able to simply passIHubinstances to code expectingIScopes, allowing for an easier migration.HubAdapter.getInstance()has been replaced byScopesAdapter.getInstance()- The
.clone()method onIHub/IScopeshas been deprecated, please use.pushScope()or.pushIsolationScope()instead - Some internal methods like
.getCurrentHub()and.setCurrentHub()have also been replaced.
Sentry.popScopehas been replaced by calling.close()on the token returned bySentry.pushScope()andSentry.pushIsolationScope(). The token can also be used in atryblock like this:
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushScope()) {
// this block has its separate current scope
}
as well as:
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushIsolationScope()) {
// this block has its separate isolation scope
}
You may also use LifecycleHelper.close(token), e.g. in case you need to pass the token around for closing later.
Features
- Report exceptions returned by Throwable.getSuppressed() to Sentry as exception groups ([#3396] https://github.com/getsentry/sentry-java/pull/3396)
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/getsentry/sentry-java - 7.9.0
Features
Fixes
- (Internal) Metrics code cleanup (#3403)
- Fix Frame measurements in app start transactions (#3382)
- Fix timing metric value different from span duration (#3368)
- Do not always write startup crash marker (#3409)
- This may have been causing the SDK init logic to block the main thread
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/getsentry/sentry-java - 7.9.0-alpha.1
- Session Replay for Android (#3339)
We released our second 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
Features
- Add start_type to app context (#3379)
Fixes
- Fix Frame measurements in app start transactions (#3382)
- Fix timing metric value different from span duration (#3368)
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/getsentry/sentry-java - 7.8.0-alpha.0
- Session Replay for Android (https://github.com/getsentry/sentry-java/pull/3339)
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
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/getsentry/sentry-java - 7.8.0
Features
Fixes
- Add rate limit to Metrics (#3334)
- Fix java.lang.ClassNotFoundException: org.springframework.web.servlet.HandlerMapping in Spring Boot Servlet mode without WebMVC (#3336)
- Fix normalization of metrics keys, tags and values (#3332)
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/getsentry/sentry-java - 7.7.0
Features
Fixes
- Fixed default deadline timeout to 30s instead of 300s (#3322)
- Fixed
Fix java.lang.ClassNotFoundException: org.springframework.web.servlet.HandlerExceptionResolverin Spring Boot Servlet mode without WebMVC (#3333)
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/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:kotlin 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.
- Kotlin
Published by getsentry-bot about 2 years ago
https://github.com/getsentry/sentry-java - 7.5.0
Features
- Add support for measurements at span level (#3219)
- Add
enableScopePersistenceoption to disablePersistingScopeObserverused 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/Supplieris executed instead of setting it to the hub that was used on the thread where theRunnable/Callable/Supplierwas 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)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 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 = trueto 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
RuntimeExceptionis thrown by the system (#3212)- This will change grouping of the issues that were previously titled
RuntimeInit$MethodAndArgsCallerto have them split up properly by the original root cause exception
- This will change grouping of the issues that were previously titled
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 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
isForNextAppStartflag, 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
HostnameVerifieroption 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
ITransportFactorythroughSentryOptions.setTransportFactory(), where you can copy over most of the parts likeHttpConnectionandAsyncHttpTransportfrom 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
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 7.2.0
Features
- Handle
monitor/check_inin client reports and rate limiter (#3096) - Add support for
graphql-javaversion 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
releaseand other fields for ANRs reported withmechanism:AppExitInfo(#3074)
Dependencies
- Bump
opentelemetry-sdkto1.33.0andopentelemetry-javaagentto1.32.0(#3112)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 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
tracesSampleRateautomatically. - Once the system goes back to healthy, we reset the
tracesSampleRateto 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
SentryOkHttpEventListenereven without transactions (#3087) - Keep
io.sentry.exception.SentryHttpClientExceptionfrom obfuscation to display proper issue title on Sentry (#3093) - (Android) Fix wrong activity transaction duration in case SDK init is deferred (#3092)
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 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
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:
kotlin
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-coreversion1.6.1or higher now (#2838) - Move enableNdk from SentryOptions to SentryAndroidOptions (#2793)
- Apollo v2 BeforeSpanCallback now allows returning null (#2890)
SentryOkHttpUtilswas removed from public API as it's been exposed by mistake (#3005)Scopenow implements theIScopeinterface, therefore some methods likeScopeCallback.runacceptIScopenow (#3066)- Cleanup
startTransactionoverloads (#2964)- We have reduced the number of overloads by allowing to pass in a
TransactionOptionsobject instead of having separate parameters for certain options TransactionOptionshas defaults set and can be customized, for example:
- We have reduced the number of overloads by allowing to pass in a
kotlin
// 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-okhttporsentry-apollo-3integrations. 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_exceededwhen 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
sendDefaultPiiif anencoderhas been configured (#2976) - The
maxSpanssetting (defaults to 1000) is enforced for nested child spans which means a single transaction can havemaxSpansnumber of children (nested or not) at most (#3065) - The
ScopeCallbackinwithScopeis now always executed (#3066)
Deprecations
sentry-android-okhttpwas deprecated in favour of the newsentry-okhttpmodule. Make sure to replaceio.sentry.android.okhttppackage name withio.sentry.okhttpbefore 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
SendCachedEnvelopeFireAndForgetIntegrationas mentioned in https://docs.sentry.io/platforms/java/configuration/#configuring-offline-caching and provide your own implementation ofIConnectionStatusProviderviaSentryOptions
- Android: it works out-of-the-box as part of the default
- Add
sentry-okhttpmodule 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
abortedin 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
defaultinterface 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.BeforeSpanCallbackwas not finishing span when it was dropped (#2958)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.34.0
Features
- Add current activity name to app context (#2999)
- Add
MonitorConfigparam 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
readBytesFromFilefor use in Hybrid SDKs (#3052) - (Internal) Add
getProguardUuidfor 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)
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 7.0.0-rc.2
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)
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.33.2-beta.1
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)
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 7.0.0-rc.1
Features
- Do not filter out Sentry SDK frames in case of uncaught exceptions (#3021)
Breaking changes:
- Cleanup startTransaction overloads (#2964)
- We have reduce the number of overloads by allowing to pass in TransactionOptions instead of having separate parameters for certain options.
- TransactionOptions has defaults set and can be customized
- Raw logback message and parameters are now guarded by sendDefaultPii if an encoder has been configured (#2976)
Fixes
- Use
getMyMemoryState()instead ofgetRunningAppProcesses()to retrieve process importance (#3004)- This should prevent some app stores from flagging apps as violating their privacy
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.33.1
Fixes
- Do not register
sentrySpringFilterin ServletContext for Spring Boot (#3027)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.33.0
Features
- Add thread information to spans (#2998)
- Use PixelCopy API for capturing screenshots on API level 24+ (#3008)
Fixes
- Fix crash when HTTP connection error message contains formatting symbols (#3002)
- Cap max number of stack frames to 100 to not exceed payload size limit (#3009)
- This will ensure we report errors with a big number of frames such as
StackOverflowError
- This will ensure we report errors with a big number of frames such as
- Fix user interaction tracking not working for Jetpack Compose 1.5+ (#3010)
- Make sure to close all Closeable resources (#3000)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.32.0
Features
- Make
DebugImagesLoaderpublic (#2993)
Fixes
- Make
SystemEventsBroadcastReceiverexported on API 33+ (#2990)- This will fix the
SystemEventsBreadcrumbsIntegrationcrashes that you might have encountered on Play Console
- This will fix the
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.31.0
Features
- Improve default debouncing mechanism (#2945)
- Add
CheckInUtils.withCheckInwhich abstracts away some of the manual check-ins complexity (#2959) - Add
@SentryCaptureExceptionParameterannotation which captures exceptions passed into an annotated method (#2764)- This can be used to replace
Sentry.captureExceptioncalls in@ExceptionHandlerof a@ControllerAdvice
- This can be used to replace
- Add
ServerWebExchangetoHintfor WebFlux asWEBFLUX_EXCEPTION_HANDLER_EXCHANGE(#2977) - Allow filtering GraphQL errors (#2967)
- This list can be set directly when calling the constructor of
SentryInstrumentation - For Spring Boot it can also be set in
application.propertiesassentry.graphql.ignored-error-types=SOME_ERROR,ANOTHER_ERROR
- This list can be set directly when calling the constructor of
Fixes
- Add OkHttp span auto-close when response body is not read (#2923)
- Fix json parsing of nullable/empty fields for Hybrid SDKs (#2968)
- (Internal) Rename
nextListtonextListOrNullto actually match what the method does - (Hybrid) Check if there's any object in a collection before trying to parse it (which prevents the "Failed to deserilize object in list" log message)
- (Hybrid) If a date can't be parsed as an ISO timestamp, attempts to parse it as millis silently, without printing a log message
- (Hybrid) If
opis not defined as part ofSpanContext, fallback to an empty string, because the filed is optional in the spec
- (Internal) Rename
- Always attach OkHttp errors and Http Client Errors only to call root span (#2961)
- Fixed crash accessing Choreographer instance (#2970)
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 7.0.0-beta.1
Features
Breaking changes:
- Capture failed HTTP requests by default (#2794)
- Reduce flush timeout to 4s on Android to avoid ANRs (#2858)
- 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
- Reduce timeout of AsyncHttpTransport to avoid ANR (#2879)
- Add deadline timeout for automatic transactions (#2865)
- This affects all automatically generated transactions on Android (UI, clicks), the default timeout is 30s
- Apollo v2 BeforeSpanCallback now allows returning null (#2890)
- 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
- Android only: If global hub mode is enabled, Sentry.getSpan() returns the root span instead of the latest span (#2855)
- 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 of IConnectionStatusProvider via SentryOptions
- Do not try to send and drop cached envelopes when rate-limiting is active (#2937)
Fixes
- Measure AppStart time till First Draw instead of
onResume(#2851) - Do not overwrite UI transaction status if set by the user (#2852)
- Capture unfinished transaction on Scope with status
abortedin 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
Breaking changes:
- Move enableNdk from SentryOptions to SentryAndroidOptions (#2793)
- Fix Coroutine Context Propagation using CopyableThreadContextElement, requires kotlinx-coroutines-core version 1.6.1 or higher (#2838)
- Bump min API to 19 (#2883)
- Fix don't overwrite the span status of unfinished spans (#2859)
- If you're using a self hosted version of sentry, sentry self hosted >= 22.12.0 is required
- 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)
- Make sure to align 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)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.30.0
Features
- Add
sendModulesoption for disable sending modules (#2926) - Send
db.systemanddb.namein span data for androidx.sqlite spans (#2928) - Check-ins (CRONS) support (#2952)
Fixes
- Always send memory stats for transactions (#2936)
- This makes it possible to query transactions by the
device.classtag on Sentry
- This makes it possible to query transactions by the
- Add
sentry.enable-aot-compatibilityproperty to SpringBoot JakartaSentryAutoConfigurationto enable building for GraalVM (#2915)
Dependencies
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.29.0
Features
- Send
db.systemanddb.namein span data (#2894) - Send
http.request.methodin span data (#2896) - Add
enablePrettySerializationOutputoption for opting out of pretty print (#2871)
- Kotlin
Published by getsentry-bot over 2 years ago
https://github.com/getsentry/sentry-java - 6.28.0
Features
- Add HTTP response code to Spring WebFlux transactions (#2870)
- Add
sampledto Dynamic Sampling Context (#2869) - Improve server side GraphQL support for spring-graphql and Nextflix DGS (#2856)
- If you have already been using
SentryDataFetcherExceptionHandlerthat still works but has been deprecated. Please useSentryGenericDataFetcherExceptionHandlercombined withSentryInstrumentationinstead for better error reporting. - More exceptions and errors caught and reported to Sentry by also looking at the
ExecutionResult(more specifically itserrors)- You may want to filter out certain errors, please see docs on filtering
- More details for Sentry events: query, variables and response (where possible)
- Breadcrumbs for operation (query, mutation, subscription), data fetchers and data loaders (Spring only)
- Better hub propagation by using
GraphQLContext
- If you have already been using
- Add autoconfigure modules for Spring Boot called
sentry-spring-bootandsentry-spring-boot-jakarta(#2880)- The autoconfigure modules
sentry-spring-bootandsentry-spring-boot-jakartahave acompileOnlydependency onspring-boot-starterwhich is needed for our auto installation in sentry-android-gradle-plugin - The starter modules
sentry-spring-boot-starterandsentry-spring-boot-starter-jakartanow bringspring-boot-starteras a dependency
- The autoconfigure modules
- You can now disable Sentry by setting the
enabledoption tofalse(#2840)
Fixes
- Propagate OkHttp status to parent spans (#2872)
- Kotlin
Published by getsentry-bot almost 3 years ago
https://github.com/getsentry/sentry-java - 6.27.0
Features
- Add TraceOrigin to Transactions and Spans (#2803)
Fixes
- Deduplicate events happening in multiple threads simultaneously (e.g.
OutOfMemoryError) (#2845)- This will improve Crash-Free Session Rate as we no longer will send multiple Session updates with
Crashedstatus, but only the one that is relevant
- This will improve Crash-Free Session Rate as we no longer will send multiple Session updates with
- Ensure no Java 8 method reference sugar is used for Android (#2857)
- Do not send session updates for terminated sessions (#2849)
- Kotlin
Published by getsentry-bot almost 3 years ago
https://github.com/getsentry/sentry-java - 6.26.0
Features
Fixes
- Fix ANRv2 thread dump parsing for native-only threads (#2839)
- Derive
TracingContextvalues from event for ANRv2 events (#2839)
- Kotlin
Published by getsentry-bot almost 3 years ago
https://github.com/getsentry/sentry-java - 6.25.2
Fixes
- Change Spring Boot, Apollo, Apollo 3, JUL, Logback, Log4j2, OpenFeign, GraphQL and Kotlin coroutines core dependencies to compileOnly (#2837)
- Kotlin
Published by getsentry-bot almost 3 years ago