Skip to content

Releases: getsentry/sentry-java

8.10.0

25 Apr 14:30

Choose a tag to compare

Features

  • Wrap configured OpenTelemetry ContextStorageProvider if 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.SentryContextStorageProvider on your java command
    • Sentry will then wrap the other ContextStorageProvider that has been configured by loading it through SPI
    • If no other ContextStorageProvider is available or there are problems loading it, we fall back to using SentryOtelThreadLocalStorage

Fixes

  • Update profile chunk rate limit and client report (#4353)

Dependencies

8.10.0-alpha.1

24 Apr 15:47

Choose a tag to compare

8.10.0-alpha.1 Pre-release
Pre-release

Features

  • Support globalHubMode for 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 ignoreStandaloneClientSpans that prevents Sentry from creating transactions for OpenTelemetry spans with kind CLIENT (#4349)
    • Defaults to false meaning standalone OpenTelemetry spans with kind CLIENT will be turned into Sentry transactions

Fixes

  • Update profile chunk rate limit and client report (#4353)

8.9.0

22 Apr 15:23

Choose a tag to compare

Features

  • Add SentryWrapper.wrapRunnable to wrap Runnable for 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
  • Reduce debug logs verbosity (#4341)
  • Fix unregister SystemEventsBroadcastReceiver when 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)

8.9.0-alpha.1

22 Apr 13:16

Choose a tag to compare

8.9.0-alpha.1 Pre-release
Pre-release

Features

  • Add SentryWrapper.wrapRunnable to wrap Runnable for use with Sentry (#4332)
  • Support globalHubMode for 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
  • Reduce debug logs verbosity (#4341)
  • Fix unregister SystemEventsBroadcastReceiver when 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)

8.8.0

14 Apr 15:32

Choose a tag to compare

Features

  • Add CoroutineExceptionHandler for reporting uncaught exceptions in coroutines to Sentry (#4259)
    • This is now part of sentry-kotlin-extensions and can be used together with SentryContext when 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 CoroutineExceptionHandler to implement custom behavior in addition to the one we provide by default

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 SystemEventsBreadcrumbsIntegration faster (#4330)

8.7.0

08 Apr 14:19

Choose a tag to compare

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.

    <application>
      <!-- Enable UI profiling, adjust in production env. This is evaluated only once per session -->
      <meta-data android:name="io.sentry.traces.profiling.session-sample-rate" android:value="1.0" />
      <!-- Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes) -->
      <meta-data android:name="io.sentry.traces.profiling.lifecycle" android:value="trace" />
      <!-- Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes -->
      <meta-data android:name="io.sentry.traces.profiling.start-on-app-start" android:value="true" />
    </application>
    import io.sentry.ProfileLifecycle;
    import io.sentry.android.core.SentryAndroid;
    
    SentryAndroid.init(context, options -> {
        // Enable UI profiling, adjust in production env. This is evaluated only once per session
        options.setProfileSessionSampleRate(1.0);
        // Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes)
        options.setProfileLifecycle(ProfileLifecycle.TRACE);
        // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes
        options.setStartProfilerOnAppStart(true);
      });
    import io.sentry.ProfileLifecycle
    import io.sentry.android.core.SentryAndroid
    
    SentryAndroid.init(context, { options ->
      // Enable UI profiling, adjust in production env. This is evaluated only once per session
      options.profileSessionSampleRate = 1.0
      // Set profiling lifecycle, can be `manual` (controlled through `Sentry.startProfiler()` and `Sentry.stopProfiler()`) or `trace` (automatically starts and stop a profile whenever a sampled trace starts and finishes)
      options.profileLifecycle = ProfileLifecycle.TRACE
      // Enable profiling on app start. The app start profile will be stopped automatically when the app start root span finishes
      options.isStartProfilerOnAppStart = true
      })
    • 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)

8.6.0

01 Apr 08:38

Choose a tag to compare

Behavioral Changes

  • The Sentry SDK will now crash on startup if mixed versions have been detected (#4277)
    • On Sentry.init / SentryAndroid.init the SDK now checks if all Sentry Java / Android SDK dependencies have the same version.
    • While this may seem like a bad idea at first glance, mixing versions of dependencies has a very high chance of causing a crash later. We opted for a controlled crash that's hard to miss.
    • Note: This detection only works for new versions of the SDK, so please take this as a reminder to check your SDK version alignment manually when upgrading the SDK to this version and then you should be good.
    • The SDK will also print log messages if mixed versions have been detected at a later point. (#4270)
      • This takes care of cases missed by the startup check above due to older versions.

Features

  • Increase http timeouts from 5s to 30s to have a better chance of events being delivered without retry (#4276)
  • Add MANIFEST.MF to Sentry JARs (#4272)
  • Retain baggage sample rate/rand values as doubles (#4279)
  • Introduce fatal SDK logger (#4288)
    • We use this to print out messages when there is a problem that prevents the SDK from working correctly.
    • One example for this is when the SDK has been configured with mixed dependency versions where we print out details, which module and version are affected.

Fixes

  • Do not override user-defined SentryOptions (#4262)
  • Session Replay: Change bitmap config to ARGB_8888 for screenshots (#4282)
  • The MANIFEST.MF of sentry-opentelemetry-agent now has Implementation-Version set to the raw version (#4291)
    • An example value would be 8.6.0
    • The value of the Sentry-Version-Name attribute looks like sentry-8.5.0-otel-2.10.0
  • Fix tags missing for compose view hierarchies (#4275)
  • Do not leak SentryFileInputStream/SentryFileOutputStream descriptors and channels (#4296)
  • Remove "not yet implemented" from Sentry.flush comment (#4305)

Internal

  • Added platform to SentryEnvelopeItemHeader (#4287)
    • Set android platform to ProfileChunk envelope item header

Dependencies

7.22.5 (Stable)

24 Mar 16:14

Choose a tag to compare

Fixes

  • Session Replay: Change bitmap config to ARGB_8888 for screenshots (#4282)

7.22.4

20 Mar 10:37

Choose a tag to compare

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)

8.5.0 (Stable)

18 Mar 17:38

Choose a tag to compare

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.

    import io.sentry.ProfileLifecycle;
    import io.sentry.android.core.SentryAndroid;
    
    SentryAndroid.init(context) { options ->
     
      // Currently under experimental options:
      options.getExperimental().setProfileSessionSampleRate(1.0);
      // In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler
      // In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes
      options.getExperimental().setProfileLifecycle(ProfileLifecycle.MANUAL);
    }
    // Start profiling
    Sentry.startProfiler();
    
    // After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped.
    Sentry.stopProfiler();
    import io.sentry.ProfileLifecycle
    import io.sentry.android.core.SentryAndroid
    
    SentryAndroid.init(context) { options ->
     
      // Currently under experimental options:
      options.experimental.profileSessionSampleRate = 1.0
      // In manual mode, you need to start and stop the profiler manually using Sentry.startProfiler and Sentry.stopProfiler
      // In trace mode, the profiler will start and stop automatically whenever a sampled trace starts and finishes
      options.experimental.profileLifecycle = ProfileLifecycle.MANUAL
    }
    // Start profiling
    Sentry.startProfiler()
    
    // After all profiling is done, stop the profiler. Profiles can last indefinitely if not stopped.
    Sentry.stopProfiler()

    To learn more visit Sentry's Continuous Profiling documentation page.

Fixes

  • Reduce excessive CPU usage when serializing breadcrumbs to disk for ANRs (#4181)
  • Ensure app start type is set, even when ActivityLifecycleIntegration is not running (#4250)
  • Use SpringServletTransactionNameProvider as fallback for Spring WebMVC (#4263)
    • In certain cases the SDK was not able to provide a transaction name automatically and thus did not finish the transaction for the request.
    • We now first try SpringMvcTransactionNameProvider which would provide the route as transaction name.
    • If that does not return anything, we try SpringServletTransactionNameProvider next, which returns the URL of the request.

Behavioral Changes

  • The user's device.name is not reported anymore via the device context, even if options.isSendDefaultPii is enabled (#4179)

Dependencies