Releases: getsentry/sentry-java
Releases · getsentry/sentry-java
8.41.0
Features
- Session Replay: experimental support for capturing
SurfaceViewcontent (e.g. Unity, video players, maps) (#5333)- To enable, set
options.sessionReplay.isCaptureSurfaceViews = true - Or via manifest:
<meta-data android:name="io.sentry.session-replay.capture-surface-views" android:value="true" /> - Warning: masking granularity is at the SurfaceView level only — the SDK cannot mask individual elements rendered inside the SurfaceView (e.g. native Unity UI, map labels, video frames). Only enable for SurfaceViews whose content is safe to record.
- To enable, set
- Add
Sentry.feedback()API forshow()andcapture()(#5349)Sentry.showUserFeedbackDialog()is deprecated in favor ofSentry.feedback().show()Sentry.captureFeedback()is deprecated in favor ofSentry.feedback().capture()Sentry.captureUserFeedback()andUserFeedbackare deprecated in favor ofSentry.feedback().capture()with the newFeedbacktypeSentryUserFeedbackDialogis deprecated in favor ofSentryUserFeedbackForm- All deprecated APIs will be removed in the next major version
- Deprecate
SentryUserFeedbackButton(View-based and Compose-based) (#5350)- It will be removed in the next major version
- Add per-form shake-to-show support for
SentryUserFeedbackForm(#5353)- Useful for enabling shake-to-report on specific screens instead of globally
SentryUserFeedbackForm.Builder(activity) .configurator { it.isUseShakeGesture = true } .create()
- Add support for Kafka (#5249)
- You will need to add the
sentry-kafkadependency and opt-in via the new option.- Set
options.setEnableQueueTracing(true)onSentry.init - Or set
sentry.enable-queue-tracing=trueinapplication.properties
- Set
- For Spring Boot Kafka is auto instrumented and no further configuration is needed.
- When using
kafka-clientsdirectly- you need to wrap your
KafkaProducerviaSentryKafkaProducer.wrap(kafkaProducer)to getqueue.publishspans - and you may use our
SentryKafkaConsumerTracing.withTracinghelper to instrument the consumer side manually. - also see https://docs.sentry.io/platforms/java/integrations/kafka/
- you need to wrap your
- You will need to add the
Fixes
- Fix soft input keyboard not being shown on the Feedback form (#5359)
- Fix shake-to-report not triggering on some devices due to high acceleration threshold (#5366)
- Fix feedback form retaining previous message when shown again via shake (#5366)
- Avoid stack overflow when deserializing large flat JSON objects (#5361)
Dependencies
8.40.0
Fixes
- Fix
NoSuchMethodErrorforLayoutCoordinates.localBoundingBoxOf$defaulton Compose touch dispatch with AGP 8.13 andminSdk < 24(#5302) - Fix reporting OkHttp's synthetic 504 "Unsatisfiable Request" responses as errors for
CacheControl.FORCE_CACHEcache misses (#5299) - Make
SentryGestureDetectorthread-safe and recycleVelocityTrackerper gesture (#5301) - Fix duplicate
ui.clickbreadcrumbs when anotherWindow.CallbackwrapsSentryWindowCallback(#5300)
Dependencies
8.39.1
Fixes
- Fix
JsonObjectReaderandMapObjectReaderhanging indefinitely when deserialization errors leave the reader in an inconsistent state (#5293)- Failed collection values are now skipped so parsing can continue
- Skipped collection values emit
WARNINGlogs - Unknown-key failures and unrecoverable recovery failures emit
ERRORlogs
8.39.0
8.38.0
Features
- Prevent cross-organization trace continuation (#5136)
- By default, the SDK now extracts the organization ID from the DSN (e.g.
o123.ingest.sentry.io) and compares it with thesentry-org_idvalue in incoming baggage headers. When the two differ, the SDK starts a fresh trace instead of continuing the foreign one. This guards against accidentally linking traces across organizations. - New option
enableStrictTraceContinuation(defaultfalse): when enabled, both the SDK's org ID and the incoming baggage org ID must be present and match for a trace to be continued. Traces with a missing org ID on either side are rejected. Configurable via code (setStrictTraceContinuation(true)),sentry.properties(enable-strict-trace-continuation=true), Android manifest (io.sentry.strict-trace-continuation.enabled), or Spring Boot (sentry.strict-trace-continuation=true). - New option
orgId: allows explicitly setting the organization ID for self-hosted and Relay setups where it cannot be extracted from the DSN. Configurable via code (setOrgId("123")),sentry.properties(org-id=123), Android manifest (io.sentry.org-id), or Spring Boot (sentry.org-id=123).
- By default, the SDK now extracts the organization ID from the DSN (e.g.
- Android: Attachments on the scope will now be synced to native (#5211)
- Add THIRD_PARTY_NOTICES.md for vendored third-party code, bundled as SENTRY_THIRD_PARTY_NOTICES.md in the sentry JAR under META-INF (#5186)
Improvements
- Do not retrieve
ActivityManagerif API < 35 on SDK init (#5275)
8.37.1
8.37.0
Fixes
- Session Replay: Fix Compose text masking mismatch with weighted text (#5218)
Features
- Add cache tracing instrumentation for Spring Boot 2, 3, and 4 (#5165)
- Wraps Spring
CacheManagerandCachebeans to produce cache spans - Set
sentry.enable-cache-tracingtotrueto enable this feature
- Wraps Spring
- Add JCache (JSR-107) cache tracing via new
sentry-jcachemodule (#5165)- Wraps JCache
CachewithSentryJCacheWrapperto produce cache spans - Set the
enableCacheTracingoption totrueto enable this feature
- Wraps JCache
- Add configurable
IScopesStorageFactorytoSentryOptionsfor providing a customIScopesStorage, e.g. when the defaultThreadLocal-backed storage is incompatible with non-pinning thread models (#5199) - Android: Add
beforeErrorSamplingcallback to Session Replay (#5214)- Allows filtering which errors trigger replay capture before the
onErrorSampleRateis checked - Returning
falseskips replay capture entirely for that error; returningtrueproceeds with the normal sample rate check - Example usage:
SentryAndroid.init(context) { options -> options.sessionReplay.beforeErrorSampling = SentryReplayOptions.BeforeErrorSamplingCallback { event, hint -> // Only capture replay for crashes (excluding e.g. handled exceptions) event.isCrashed } }
- Allows filtering which errors trigger replay capture before the
Dependencies
- Bump Native SDK from v0.13.2 to v0.13.3 (#5215)
- Bump OpenTelemetry (#5225)
opentelemetryto1.60.1(was1.57.0)opentelemetry-instrumentationto2.26.0(was2.23.0)opentelemetry-instrumentation-alphato2.26.0-alpha(was2.23.0-alpha)opentelemetry-semconvto1.40.0(was1.37.0)opentelemetry-semconv-alphato1.40.0-alpha(was1.37.0-alpha)
8.36.0 (Stable)
Features
- Show feedback form on device shake (#5150)
- Enable via
options.getFeedbackOptions().setUseShakeGesture(true)or manifest meta-dataio.sentry.feedback.use-shake-gesture - Uses the device's accelerometer — no special permissions required
- Enable via
Fixes
- Support masking/unmasking and click/scroll detection for Jetpack Compose 1.10+ (#5189)
Dependencies
8.35.0 (Stable)
Fixes
- Android: Remove the dependency on protobuf-lite for tombstones (#5157)
Features
- Add new experimental option to capture profiles for ANRs (#4899)
- This feature will capture a stack profile of the main thread when it gets unresponsive
- The profile gets attached to the ANR event on the next app start, providing a flamegraph of the ANR issue on the sentry issue details page
- Enable via
options.setAnrProfilingSampleRate(<sample-rate>)or AndroidManifest.xml:<meta-data android:name="io.sentry.anr.profiling.sample-rate" android:value="[0.0-1.0]" /> - The sample rate controls the probability of collecting a profile for each detected foreground ANR (0.0 to 1.0, null to disable)
Behavioral Changes
- Add
enableAnrFingerprintingoption which assigns static fingerprints to ANR events with system-only stacktraces- When enabled, ANRs whose stacktraces contain only system frames (e.g.
java.langorandroid.os) are grouped into a single issue instead of creating many separate issues - This will help to reduce overall ANR issue noise in the Sentry dashboard
- IMPORTANT: This option is enabled by default.
- Disable via
options.setEnableAnrFingerprinting(false)or AndroidManifest.xml:<meta-data android:name="io.sentry.anr.enable-fingerprinting" android:value="false" />
- When enabled, ANRs whose stacktraces contain only system frames (e.g.