Releases: getsentry/sentry-java
Releases · getsentry/sentry-java
Release list
8.57.0
Behavioral Changes
- Measure HTTP rate-limit backoff on a monotonic clock instead of the wall clock, so that a device time change no longer lifts or extends an active rate limit (#6030)
Features
- Add Android SDK support for reporting
MemoryLimiterapp exits recovered fromApplicationExitInfo(#6111). - Sentry can now configure Log4j2 automatically for Spring Boot 4 when
sentry-log4j2is on the classpath and Log4j2 Core is the active logging backend (#5403)- Enable automatic appender registration with:
Automatic registration is disabled by default for now and will be enabled by default in the next major release.
sentry.logging.enabled=true - The appender is attached to the root logger by default. To attach it to specific loggers instead, configure one or more non-overlapping logger names:
sentry.logging.loggers[0]=com.example sentry.logging.loggers[1]=org.example
- Configure the minimum level for creating breadcrumbs. The default is
INFO:sentry.logging.minimum-breadcrumb-level=INFO - Configure the minimum level for creating Sentry error events. The default is
ERROR:sentry.logging.minimum-event-level=ERROR - Configure the minimum level for sending Sentry structured logs. The default is
INFO:Structured logs must also be enabled:sentry.logging.minimum-level=INFOsentry.logs.enabled=true
- Enable automatic appender registration with:
- Sentry can now configure Log4j2 automatically for Spring Boot 3 when
sentry-log4j2is on the classpath and Log4j2 Core is the active logging backend (#6072)- Disabled by default for now; enable it and configure levels the same way as described in the Spring Boot 4 entry above (
sentry.logging.enabled=true)
- Disabled by default for now; enable it and configure levels the same way as described in the Spring Boot 4 entry above (
Fixes
- Keep resolving the server name after
Sentry.close()or a re-init. Closing the SDK shut down the shared hostname cache for the life of the process, soserver_namesilently froze at the value it had last resolved (#6119) - Order breadcrumbs by the timestamp they carry rather than by when they were created in the current process, so breadcrumbs restored from disk or handed over by a hybrid SDK no longer sort as if they had just happened (#6097)
Internal
- Deprecate
RateLimiter(ICurrentDateProvider, SentryOptions)in favor ofRateLimiter(SentryOptions), whose backoff is measured on a monotonic ticker (#6030) - Deprecate
AndroidCurrentDateProvider.getInstance()in favor ofMonotonicTicker, which counts time spent in deep sleep and cannot be confused with the epoch-basedCurrentDateProvider(#6103)
8.56.0
Fixes
- Update
SentryTracedso that it now honorsoptions.setIgnoredSpanOrigins(#6058) SentryTracednow checks for its owning transaction dynamically rather than once per app process. The latter causedSentryTracedspans to be dropped process-wide once the original transaction finished (#6057)- Fix typos in Spring GraphQL integration names (
GrahQLtoGraphQL) (#6061) - Populate the Android connection status cache during the first two minutes after boot, instead of treating the empty cache as up to date (#6029)
- Prevent
SentryTracedfrom producing dangling spans if recomposition is abandoned or drawing fails (#6049) - Report a consistent app start type across the app start measurement,
contexts.appand theapp.startspan attributes (#6006)
Improvements
- Emit a single
ui.composespan perSentryTracedon initial composition instead of one on every recomposition, and set the origin onui.renderspans (#6051)
Internal
- Add an internal
MonotonicTickerabstraction withDeadlineandStopwatchprimitives (#6028) - Add internal
Timestamp,EpochClockandAnchoredClock, so related instants project from one wall-clock reading instead of each reading the clock (#6045)
Dependencies
8.55.0
Features
- Add
Session.State.Unhandledfor unhandled errors that do not terminate the process (#5919)
Improvements
- Move ANR profiling out of experimental (#6042)
Fixes
- Keep dropped tombstone and ANR events dropped, instead of reporting the same app exit again at every app start (#6002)
- Apply
Sentry.withScopeandSentry.withIsolationScopedata to events captured inside the callback whenglobalHubModeis enabled (#6004)globalHubModeis enabled by default on Android, where tags, extras, contexts and level set inside the callback were silently dropped- Scopes that are explicitly made current, e.g. via
Sentry.setCurrentScopesor theSentryContextcoroutine integration, are now also honoured whenglobalHubModeis enabled Sentry.pushScope,Sentry.pushIsolationScopeandSentry.popScoperemain no-ops whenglobalHubModeis enabled
- Drop the
profiler_idfrom transactions and spans when no Perfetto profile covers them, e.g. when Android'sProfilingManagerrate limits the profiling request (#6015) - Prevent events from being dropped when feature flags are added while an event is being captured (#5989)
Internal
- Add
InternalSentrySdk.captureEnvelopeNonTerminatingfor hybrid SDKs (e.g. Flutter) so unhandled exceptions that don't terminate the process no longer end the session ascrashed(#5921) - Add
InternalSentrySdk.updateSessionForDroppedEventNonTerminatingso hybrid SDKs can still update the session when an error is dropped by sampling (#5990)
Dependencies
8.54.0
Features
- Set
app.vitals.start.screenandapp.vitals.start.typeon standaloneapp.startchildren (#6005) - Add screenshot attachment button to the Android user feedback widget (#5828)
- Users can now attach a screenshot when submitting feedback. Enabled by default; can be disabled via
SentryFeedbackOptions.setEnableAttachScreenshot(false)or theio.sentry.feedback.enable-attach-screenshotmanifest flag. - Requires the
androidx.activity>=1.8.2dependency
- Users can now attach a screenshot when submitting feedback. Enabled by default; can be disabled via
- Add manual Session Replay controls through
Sentry.replay()(#5978)- Explicit
start()andstartBuffering()calls bypass the configured replay sample rates; sampling still controls automatic startup. start()starts a full-session replay and does nothing if one is already recording.startBuffering()keeps a rolling buffer that is sent onflush()or an error, then continues in session mode.stop()ends the current replay; the nextstart()creates a new replay session.pause()suspends recording untilresume()and remains paused across background and foreground transitions and automatic replay restarts in the same process.resume()continues the same manually paused replay.flush()sends the current replay data, or starts a full-session replay when recording is stopped.
- Explicit
Fixes
- Prevents inclusion of
null.prefix before default-package class names when parsing Java and JNI frames from Android ANR thread dumps (#5979) - Prevent duplicated breadcrumbs on tombstone-merged native crash events (#5888)
- Prevent a class of Session Replay deadlocks by confining lifecycle state changes to Android's main thread (#5965)
- Symbolicate tombstone native frames for libraries loaded directly from APKs (#5992)
- Prevent a deadlock between the app start extension and the Android performance event processor (#6007)
Performance
- Defer starting Session Replay off the SDK initialization critical path (#5965)
- Use manifest metadata resolved at build time to reduce Android SDK initialization overhead (#5976)
Dependencies
8.53.0 (Stable)
Features
- Allow child spans to use explicit start timestamps through
ISpan(#5929) - Make
ISpan.startChildoverloads withSpanOptionspublic (#5927)
Improvements
- Remove
ApiStatus.Experimentalannotation fromSentrySQLiteDriver(#5938)
Fixes
- Clear contexts when calling
Scope.clear()(#5902) - Preserve custom
Throwableidentities when R8 optimizes Android apps (#5881) - Report the correct cpu usage for the first performance sample of a transaction, which was measured against the time since device boot (#5926)
- Prevent an ANR when the Session Replay video encoder gets stuck (#5842)
- Some hardware encoders never signal end-of-stream, which made the replay worker spin forever while holding the encoder lock. The app's lifecycle callbacks then blocked on that lock and the app froze until the system killed it. The encoder now gives up instead of spinning, and closing the replay cache no longer waits indefinitely for a wedged encoder.
Performance
- Read the clock once per performance collection round instead of once per in-flight transaction (#5934)
- Reduce allocations while collecting cpu usage during transactions by reading the process cpu time via
Process.getElapsedCpuTime()instead of parsing/proc/self/stat(33.6kB to 16 bytes per sample on a Pixel 3) (#5926) - Store performance measurements as primitives, removing a boxed allocation per measurement per performance sample (#5935)
Dependencies
8.52.0 (Stable)
Fixes
- Restore the interrupt flag when cached envelope processing is interrupted between files (#5884)
- Reduce false-positive SDK crash attribution for host app SQLite cursor crashes (#5883)
- Prevent inflated cold app start when the OS spawns the process in the background (e.g. FCM push) on API 35+ (#5841, #5880)
- Preserve single-sample ANR profile chunks so profiles remain available on ANR events (#5872)
- Avoid a CPU busy-loop when recording discarded log or metric envelopes under rate limiting (#5835)
ClientReportRecordernow reads the item count from the envelope item header instead of deserializing the payload, which under sustained rate limiting could pin CPU cores while repeatedly throwing exceptions
- Report tasks handed to a no-op
ISentryExecutorServiceas cancelled (#5874)NoOpSentryExecutorServicepreviously returned aFuturethat was never run and never cancelled, so callers could not tell a dropped task from a queued one andget()would block until its timeout
Performance
- Defer use of reflection by
SentryFrameMetricsCollectorduringSentry.init(#5886) - Avoid waiting up to
shutdownTimeoutMilliswhen closing the SDK with a pending transaction timeout or session-end task (#5851) - Use
RGB_565instead ofARGB_8888for screenshot and replay capture bitmaps, halving per-frame memory usage (#5821) - Remove an unused lock from
SentryPerformanceProvider, which was allocated on every cold start inContentProvider.onCreatewithout ever being acquired (#5871) - Reduce main-thread allocations when parsing the app start profiling config (#5867)
- Batch and coalesce scope-persistence disk writes to reduce startup cost (#5791)
- Scope mutations are now coalesced (latest value per field) and breadcrumbs are appended in batches behind a single fsync, instead of one synchronous disk write per mutation.
- Reduce the number of SDK threads: the
HostnameCacheworker thread now times out while idle instead of staying alive for the whole process lifetime (#5817)
Dependencies
8.51.0
Features
- Use Android's
ProfilingManager(Perfetto) for continuous profiling on API 35+ devices (#5251)- On API 35+ devices, continuous profiling now automatically uses Android's system
ProfilingManagerwith Perfetto-based stack sampling, providing lower-overhead and more accurate profiles. No configuration change is required. - Devices below API 35 keep using the legacy
Debug-based profiler. - Added an
enableLegacyProfilingoption (defaulttrue) to disable the legacyDebug-based profiler. Setting it tofalsedisables continuous profiling on API < 35 devices as well as transaction-based profiling (profilesSampleRate/profilesSampler) on all devices, since transaction-based profiling is not supported by Perfetto. - It can also be configured via the
io.sentry.profiling.enable-legacy-profilingmanifest flag. - See the Android profiling docs for details.
- On API 35+ devices, continuous profiling now automatically uses Android's system
Behavioral Changes
- The outbox and cache directories are no longer created by
Sentry.init(#5792)- They are now created lazily by whichever component first writes into them, off the init thread. As a result, the directories at
SentryOptions.getOutboxPath()andSentryOptions.getCacheDirPath()are not guaranteed to exist onceSentry.initreturns. - If you write envelopes into the outbox path yourself instead of going through the SDK — as hybrid SDKs do for
captureEnvelope— create the directory first, e.g.new File(outboxPath).mkdirs().
- They are now created lazily by whichever component first writes into them, off the init thread. As a result, the directories at
Improvements
- Skip building Android manifest metadata debug log messages when debug logging is disabled, reducing allocations during SDK init (#5790)
Fixes
- Use the original app build's ProGuard UUID for ANR profile chunks (#5852)
- Fix potential ANR/deadlock in Session Replay when
checkCanRecordruns on the replay executor thread (#5837) - Prevent concurrent PixelCopy access during Session Replay masking and bitmap cleanup (#5808)
- Release
MediaMuxerwhen the replay video encoder fails to start to avoid a resource leak (#5607) - Set the correct platform (
androidinstead ofjava) on ANR profile chunks so they are billed as UI Profile Hours rather than Continuous Profile Hours (#5836) - Skip encoding and capturing buffered session replay segments while rate-limited, so we don't waste resources on envelopes the transport will drop (#5813)
- These skipped replays are now reported as
ratelimit_backoffdiscarded events in client reports, so they no longer disappear from drop statistics. One event is recorded per buffer flush rather than per segment. - Buffer mode is also kept while rate-limited instead of switching to session mode, so the rolling buffer stays warm and the next error after the rate limit expires can send a complete replay.
- These skipped replays are now reported as
Performance
- Create the outbox and cache directories lazily in their consumers instead of during SDK init, moving the
mkdirs()calls off the init (main) thread (#5792) - Reduce the number of SDK threads:
LifecycleWatchernow schedules the session-end task on the shared timer executor instead of creating a dedicatedjava.util.Timerthread (#5819) - Reduce the number of SDK threads:
RateLimiternow schedules its rate-limit-lifted notifications on the shared timer executor instead of creating a dedicatedjava.util.Timerthread (#5814) - Speed up deserialization of arbitrary JSON objects by typing numbers without throwing exceptions (#5783)
Dependencies
8.50.1
Fixes
- Pin the published Sentry Android SDK's AAR metadata
minCompileSdkto ourminSdk(21) instead of AGP 9's new default of the SDK's owncompileSdk(37), so apps that depend on the SDK aren't forced to raise theircompileSdk(#5823)
8.50.0
Android 17 support
- We've put Android 17 through a set of rigorous tests. We're now officially giving it the Sentry stamp of compatibility .(#5796)
Fixes
- Reduce main-thread work during
Sentry.initby resolving the shake-detector accelerometer off the main thread (~1.75ms on a Pixel 10) (#5784) - Backfill release, environment, distribution, tags, and app version/build—and use the matching replay-on-error sample rate—for
ApplicationExitInfoANR and native crash events captured before SDK initialization, without reusing options cached by a later app update (#5762) SentryTagModifierNode.isImportantForBoundsnow matches the default behavior and returnstrue(#5789)- Prevent a
StackOverflowErrorwhen abeforeSend,beforeBreadcrumb,beforeSendLog, orbeforeEnvelopecallback triggers another capture (directly or through a logging integration such as Timber) (#5737)- Captures made from within a user callback (event, transaction, breadcrumb, log, envelope, or check-in) are now dropped while that callback runs, instead of recursing. Captures made by event processors are unaffected.
- Replace deprecated
ThrowableProxywithLogEvent#getThrown()insentry-log4j2(#5751)
Dependencies
8.49.0 (Stable)
Features
-
Session Replay: Record segment names (transaction names) (#5763)
-
Add
io.sentry:sentry-opentelemetry-bomto align Sentry OpenTelemetry modules with tested OpenTelemetry dependencies (#5629)- Spring Boot Gradle plugin: add the Sentry BOM to
dependencyManagement; explicit imports are applied after Spring Boot's implicit BOMdependencyManagement { imports { mavenBom("io.sentry:sentry-opentelemetry-bom:<sentry-version>") } } - Gradle: import it as a platform and omit versions from Sentry OpenTelemetry and OpenTelemetry dependencies
implementation(platform("io.sentry:sentry-opentelemetry-bom:<sentry-version>")) - Maven: import it before Spring Boot's BOM in the same
<dependencyManagement>block, or in the child POM when usingspring-boot-starter-parent<dependency> <groupId>io.sentry</groupId> <artifactId>sentry-opentelemetry-bom</artifactId> <version>${sentry.version}</version> <type>pom</type> <scope>import</scope> </dependency>
- Spring Boot Gradle plugin: add the Sentry BOM to
Fixes
- Session Replay: Fix first recording segment missing for replays in
buffermode (#5753) - Session Replay: Fix error-to-replay linkage in
buffermode (#5754) - Prevent logs and metrics from remaining queued after a flush scheduling race (#5756)
- Fix main thread identification for tombstone (native crash) events (#5742)
- Prevent malformed JDBC URLs, which may contain credentials, from being printed to stdout (#5656)
- Restrict JVM-global proxy authentication credentials to challenges from the configured proxy host (#5656)
- Sanitize Spring 7 and Spring Jakarta WebClient span descriptions to prevent embedded URL credentials from being sent to Sentry (#5656)
- Respect
tracePropagationTargetswhen injecting Sentry tracing headers through the OpenTelemetry OTLP propagator (#5656)
Performance
- Schedule transaction idle/deadline timeouts on a shared, dedicated executor instead of spawning a
Timerthread per transaction (#5670)
Dependencies
- Bump OpenTelemetry to support Spring Boot 4.1 (#5573)
- If this causes issues for you because you are also using Spring Boot Dependency Management Plugin (io.spring.dependency-management),
which may downgrade the OpenTelemetry SDK, please have a look at the changelog entry above that explains how to usesentry-opentelemetry-bom. - OpenTelemetry to 1.63.0 (was 1.60.1)
- OpenTelemetry Instrumentation to 2.29.0 (was 2.26.0)
- OpenTelemetry Instrumentation Alpha to 2.29.0-alpha (was 2.26.0-alpha)
- OpenTelemetry Semantic Conventions to 1.42.0 (was 1.40.0)
- OpenTelemetry Semantic Conventions Alpha to 1.42.0-alpha (was 1.40.0-alpha)
- If this causes issues for you because you are also using Spring Boot Dependency Management Plugin (io.spring.dependency-management),
- Bump Native SDK from v0.15.2 to v0.15.3 (#5728)