Skip to content

Releases: getsentry/sentry-java

8.0.0-alpha.1

14 May 14:45
Compare
Choose a tag to compare
8.0.0-alpha.1 Pre-release
Pre-release

Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:

  • New Scope types have been introduced, see "Behavioural Changes" for more details.
  • Lifecycle tokens have been introduced to manage Scope lifecycle, see "Behavioural Changes" for more details.
  • Hub has been replaced by Scopes

Behavioural Changes

  • We're introducing some new Scope types 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. Since Hub is 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.init has been called. It can be manipulated using Sentry.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 @Async and 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.
  • Sentry.popScope has been deprecated, please call .close() on the token returned by Sentry.pushScope instead 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 like Sentry.setTag()
    • For Android the type defaults to CURRENT scope
    • For Backend and other JVM applicatons it defaults to ISOLATION scope
  • Event processors on Scope can now be ordered by overriding the getOrder method on implementations of EventProcessor. NOTE: This order only applies to event processors on Scope but not SentryOptions at the moment. Feel free to request this if you need it.
  • Hub is deprecated in favor of Scopes, alongside some Hub relevant APIs. More details can be found in the "Migration Guide" section.

Breaking Changes

  • Contexts no longer extends ConcurrentHashMap, instead we offer a selected set of methods.

Migration Guide / Deprecations

  • Hub has been deprecated, we're replacing the following:
    • IHub has been replaced by IScopes, however you should be able to simply pass IHub instances to code expecting IScopes, allowing for an easier migration.
    • HubAdapter.getInstance() has been replaced by ScopesAdapter.getInstance()
    • The .clone() method on IHub/IScopes has been deprecated, please use .pushScope() or .pushIsolationScope() instead
    • Some internal methods like .getCurrentHub() and .setCurrentHub() have also been replaced.
  • Sentry.popScope has been replaced by calling .close() on the token returned by Sentry.pushScope() and Sentry.pushIsolationScope(). The token can also be used in a try block 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] #3396)

7.9.0

08 May 13:05
Compare
Choose a tag to compare

Features

  • Add start_type to app context (#3379)
  • Add ttid/ttfd contribution flags (#3386)

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

7.9.0-alpha.1

26 Apr 15:19
Compare
Choose a tag to compare
7.9.0-alpha.1 Pre-release
Pre-release
  • 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)

7.8.0

09 Apr 12:50
Compare
Choose a tag to compare

Features

  • Add description to OkHttp spans (#3320)
  • Enable backpressure management by default (#3284)

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)

7.8.0-alpha.0

09 Apr 13:50
Compare
Choose a tag to compare
7.8.0-alpha.0 Pre-release
Pre-release
  • Session Replay for Android (#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

7.7.0

08 Apr 10:12
Compare
Choose a tag to compare

Features

  • Add support for Spring Rest Client (#3199)
  • Extend Proxy options with proxy type (#3326)

Fixes

  • Fixed default deadline timeout to 30s instead of 300s (#3322)
  • Fixed Fix java.lang.ClassNotFoundException: org.springframework.web.servlet.HandlerExceptionResolver in Spring Boot Servlet mode without WebMVC (#3333)

7.6.0

08 Mar 12:30
Compare
Choose a tag to compare

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:
    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.

7.5.0

01 Mar 13:09
Compare
Choose a tag to compare

Features

  • Add support for measurements at span level (#3219)
  • Add enableScopePersistence option to disable PersistingScopeObserver used for ANR reporting which may increase performance overhead. Defaults to true (#3218)
    • When disabled, the SDK will not enrich ANRv2 events with scope data (e.g. breadcrumbs, user, tags, etc.)
  • Configurable defaults for Cron - MonitorConfig (#3195)
  • We now display a warning on startup if an incompatible version of Spring Boot is detected (#3233)
    • This should help notice a mismatching Sentry dependency, especially when upgrading a Spring Boot application
  • Experimental: Add Metrics API (#3205)

Fixes

  • Ensure performance measurement collection is not taken too frequently (#3221)
  • Fix old profiles deletion on SDK init (#3216)
  • Fix hub restore point in wrappers: SentryWrapper, SentryTaskDecorator and SentryScheduleHook (#3225)
    • We now reset the hub to its previous value on the thread where the Runnable/Callable/Supplier is executed instead of setting it to the hub that was used on the thread where the Runnable/Callable/Supplier was created.
  • Fix add missing thread name/id to app start spans (#3226)

7.4.0

21 Feb 12:43
Compare
Choose a tag to compare

Features

  • Add new threshold parameters to monitor config (#3181)
  • Report process init time as a span for app start performance (#3159)
  • (perf-v2): Calculate frame delay on a span level (#3197)
  • Resolve spring properties in @SentryCheckIn annotation (#3194)
  • Experimental: Add Spotlight integration (#3166)
    • For more details about Spotlight head over to https://spotlightjs.com/
    • Set options.isEnableSpotlight = true to enable Spotlight

Fixes

  • Don't wait on main thread when SDK restarts (#3200)
  • Fix Jetpack Compose widgets are not being correctly identified for user interaction tracing (#3209)
  • Fix issue title on Android when a wrapping RuntimeException is thrown by the system (#3212)
    • This will change grouping of the issues that were previously titled RuntimeInit$MethodAndArgsCaller to have them split up properly by the original root cause exception

7.3.0

30 Jan 10:16
Compare
Choose a tag to compare

Features

  • Added App Start profiling
    • This depends on the new option io.sentry.profiling.enable-app-start, other than the already existing io.sentry.traces.profiling.sample-rate.
    • Sampler functions can check the new isForNextAppStart flag, to adjust startup profiling sampling programmatically.
      Relevant PRs:
    • Decouple Profiler from Transaction (#3101)
    • Add options and sampling logic (#3121)
    • Add ContentProvider and start profile (#3128)
  • 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
  • Fix UserFeedback disk cache name conflicts with linked events (#3116)

Breaking changes

  • Remove HostnameVerifier option as it's flagged by security tools of some app stores (#3150)
    • If you were using this option, you have 3 possible paths going forward:
      • Provide a custom ITransportFactory through SentryOptions.setTransportFactory(), where you can copy over most of the parts like HttpConnection and AsyncHttpTransport from the SDK with necessary modifications
      • Get a certificate for your server through e.g. Let's Encrypt
      • Fork the SDK and add the hostname verifier back

Dependencies