Skip to content

Releases: getsentry/sentry-java

8.37.0

25 Mar 11:17

Choose a tag to compare

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 CacheManager and Cache beans to produce cache spans
    • Set sentry.enable-cache-tracing to true to enable this feature
  • Add JCache (JSR-107) cache tracing via new sentry-jcache module (#5165)
    • Wraps JCache Cache with SentryJCacheWrapper to produce cache spans
    • Set the enableCacheTracing option to true to enable this feature
  • Add configurable IScopesStorageFactory to SentryOptions for providing a custom IScopesStorage, e.g. when the default ThreadLocal-backed storage is incompatible with non-pinning thread models (#5199)
  • Android: Add beforeErrorSampling callback to Session Replay (#5214)
    • Allows filtering which errors trigger replay capture before the onErrorSampleRate is checked
    • Returning false skips replay capture entirely for that error; returning true proceeds 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
              }
      }

Dependencies

  • Bump Native SDK from v0.13.2 to v0.13.3 (#5215)
  • Bump OpenTelemetry (#5225)
    • opentelemetry to 1.60.1 (was 1.57.0)
    • opentelemetry-instrumentation to 2.26.0 (was 2.23.0)
    • opentelemetry-instrumentation-alpha to 2.26.0-alpha (was 2.23.0-alpha)
    • opentelemetry-semconv to 1.40.0 (was 1.37.0)
    • opentelemetry-semconv-alpha to 1.40.0-alpha (was 1.37.0-alpha)

8.36.0

17 Mar 17:56

Choose a tag to compare

Features

  • Show feedback form on device shake (#5150)
    • Enable via options.getFeedbackOptions().setUseShakeGesture(true) or manifest meta-data io.sentry.feedback.use-shake-gesture
    • Uses the device's accelerometer — no special permissions required

Fixes

  • Support masking/unmasking and click/scroll detection for Jetpack Compose 1.10+ (#5189)

Dependencies

  • Bump Native SDK from v0.13.1 to v0.13.2 (#5181)
  • Bump com.abovevacant:epitaph to 0.1.1 to avoid old D8/R8 dexing crashes in downstream Android builds on old AGP versions such as 7.4.x. (#5200)

8.35.0

12 Mar 11:44

Choose a tag to compare

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 enableAnrFingerprinting option which assigns static fingerprints to ANR events with system-only stacktraces
    • When enabled, ANRs whose stacktraces contain only system frames (e.g. java.lang or android.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" />

8.34.1

05 Mar 15:54

Choose a tag to compare

Fixes

  • Common: Finalize previous session even when auto session tracking is disabled (#5154)
  • Android: Add filterTouchesWhenObscured to prevent Tapjacking on user feedback dialog (#5155)
  • Android: Add proguard rules to prevent error about missing Replay classes (#5153)

8.34.0

04 Mar 11:56

Choose a tag to compare

Features

  • Add scope-level attributes API (#5118) via (#5148)
    • Automatically include scope attributes in logs and metrics (#5120)
    • New APIs are Sentry.setAttribute, Sentry.setAttributes, Sentry.removeAttribute
  • Support collections and arrays in attribute type inference (#5124)
  • Add support for SENTRY_SAMPLE_RATE environment variable / sample-rate property (#5112)
  • Create sentry-opentelemetry-otlp and sentry-opentelemetry-otlp-spring modules for combining OpenTelemetry SDK OTLP export with Sentry SDK (#5100)
    • OpenTelemetry is configured to send spans to Sentry directly using an OTLP endpoint.
    • Sentry only uses trace and span ID from OpenTelemetry (via OpenTelemetryOtlpEventProcessor) but will not send spans through OpenTelemetry nor use OpenTelemetry Context for Scopes propagation.
    • See the OTLP setup docs for Java and Spring Boot for installation and configuration instructions.
  • Add screenshot masking support using view hierarchy (#5077)
    • Masks sensitive content (text, images) in error screenshots using the same view hierarchy approach as Session Replay
    • Requires the sentry-android-replay module to be present at runtime for masking to work
    • Enable via code:
      SentryAndroid.init(context) { options ->
          options.isAttachScreenshot = true
          options.screenshot.setMaskAllText(true)
          options.screenshot.setMaskAllImages(true)
          // Or mask specific view classes
          options.screenshot.addMaskViewClass("com.example.MyCustomView")
      }
    • Or via AndroidManifest.xml:
      <meta-data android:name="io.sentry.attach-screenshot" android:value="true" />
      <meta-data android:name="io.sentry.screenshot.mask-all-text" android:value="true" />
      <meta-data android:name="io.sentry.screenshot.mask-all-images" android:value="true" />
  • The ManifestMetaDataReader now read the DIST (#5107)

Fixes

  • Fix attribute type detection for Long, Short, Byte, BigInteger, AtomicInteger, and AtomicLong being incorrectly inferred as double instead of integer (#5122)
  • Remove AndroidRuntimeManager StrictMode relaxation to prevent ANRs during SDK init (#5127)
    • IMPORTANT: StrictMode violations may appear again in debug builds. This is intentional to prevent ANRs in production releases.
  • Fix crash when unregistering SystemEventsBroadcastReceiver with try-catch block. (#5106)
  • Use peekDecorView instead of getDecorView in SentryGestureListener to avoid forcing view hierarchy construction (#5134)
  • Log an actionable error message when Relay returns HTTP 413 (Content Too Large) (#5115)
    • Also switch the client report discard reason for all HTTP 4xx/5xx errors (except 429) from network_error to send_error
  • Trim DSN string before parsing to avoid URISyntaxException caused by trailing whitespace (#5113)
  • Reduce allocations and bytecode instructions during Sentry.init (#5135)

Dependencies

8.33.0

18 Feb 13:28

Choose a tag to compare

Features

  • Add installGroupsOverride parameter to Build Distribution SDK for programmatic filtering, with support for configuration via properties file using io.sentry.distribution.install-groups-override (#5066)

Fixes

  • When merging tombstones with Native SDK, use the tombstone message if the Native SDK didn't explicitly provide one. (#5095)
  • Fix thread leak caused by eager creation of SentryExecutorService in SentryOptions (#5093)
    • There were cases where we created options that ended up unused but we failed to clean those up.
  • Attach user attributes to logs and metrics regardless of sendDefaultPii (#5099)
  • No longer log a warning if a logging integration cannot initialize Sentry due to missing DSN (#5075)
    • While this may have been useful to some, it caused lots of confusion.
  • Session Replay: Add androidx.camera.view.PreviewView to default maskedViewClasses to mask camera previews by default. (#5097)

Dependencies

Internal

  • Add integration to track session replay custom masking (#5070)

8.32.0

09 Feb 10:10

Choose a tag to compare

Features

  • Add installGroupsOverride parameter and installGroups property to Build Distribution SDK (#5062)
  • Update Android targetSdk to API 36 (Android 16) (#5016)
  • Add AndroidManifest support for Spotlight configuration via io.sentry.spotlight.enable and io.sentry.spotlight.url (#5064)
  • Collect database transaction spans (BEGIN, COMMIT, ROLLBACK) (#5072)
    • To enable creation of these spans, set options.enableDatabaseTransactionTracing to true
    • enable-database-transaction-tracing=true when using sentry.properties
    • For Spring Boot, use sentry.enable-database-transaction-tracing=true in application.properties or in application.yml:
      sentry:
        enable-database-transaction-tracing: true
  • Add support for collecting native crashes using Tombstones (#4933, #5037)
    • Added Tombstone integration that detects native crashes using ApplicationExitInfo.REASON_CRASH_NATIVE on Android 12+
    • Crashes enriched with Tombstones contain more crash details and detailed thread info
    • Tombstone and NDK integrations are now automatically merged into a single crash event, eliminating duplicate reports
    • To enable it, add the integration in your Sentry initialization:
      SentryAndroid.init(context, options -> {
          options.isTombstoneEnabled = true
      })
      or in the AndroidManifest.xml using:
      <meta-data android:name="io.sentry.tombstone.enable" android:value="true" />

Fixes

  • Extract SpotlightIntegration to separate sentry-spotlight module to prevent insecure HTTP URLs from appearing in release APKs (#5064)
    • Breaking: Users who enable Spotlight must now add the io.sentry:sentry-spotlight dependency:
      dependencies {
          debugImplementation("io.sentry:sentry-spotlight:<version>")
      }
  • Fix scroll target detection for Jetpack Compose (#5017)
  • No longer fork Sentry Scopes for reactor-kafka consumer poll Runnable (#5080)
    • This was causing a memory leak because reactor-kafka's poll event reschedules itself infinitely, and each invocation of SentryScheduleHook created forked scopes with a parent reference, building an unbounded chain that couldn't be garbage collected.
  • Fix cold/warm app start type detection for Android devices running API level 34+ (#4999)

Internal

  • Establish new native exception mechanisms to differentiate events generated by sentry-native from ApplicationExitInfo. (#5052)
  • Set write permission for statuses in the changelog preview GHA workflow. (#5053)

Dependencies

8.31.0 (Stable)

21 Jan 13:56

Choose a tag to compare

Features

  • Added io.sentry.ndk.sdk-name Android manifest option to configure the native SDK's name (#5027)
  • Replace sentry.trace.parent_span_id attribute with spanId property on SentryLogEvent (#5040)

Fixes

  • Only attach user attributes to logs if sendDefaultPii is enabled (#5036)
  • Reject new logs if LoggerBatchProcessor is shutting down (#5041)
  • Downgrade protobuf-javalite dependency from 4.33.1 to 3.25.8 (#5044)

Dependencies

8.30.0

15 Jan 10:01

Choose a tag to compare

Fixes

  • Fix ANRs when collecting device context (#4970)
    • IMPORTANT: This disables collecting external storage size (total/free) by default, to enable it back
      use options.isCollectExternalStorageContext = true or <meta-data android:name="io.sentry.external-storage-context" android:value="true" />
  • Fix NullPointerException when reading ANR marker (#4979)
  • Report discarded log in batch processor as log_byte (#4971)

Improvements

  • Expose MAX_EVENT_SIZE_BYTES constant in SentryOptions (#4962)
  • Discard envelopes on 4xx and 5xx response (#4950)
    • This aims to not overwhelm Sentry after an outage or load shedding (including HTTP 429) where too many events are sent at once

Feature

  • Add a Tombstone integration that detects native crashes without relying on the NDK integration, but instead using ApplicationExitInfo.REASON_CRASH_NATIVE on Android 12+. (#4933)
    • Currently exposed via options as an internal API only.
    • If enabled alongside the NDK integration, crashes will be reported as two separate events. Users should enable only one; deduplication between both integrations will be added in a future release.
  • Add Sentry Metrics to Java SDK (#5026)
    • Metrics are enabled by default
    • APIs are namespaced under Sentry.metrics()
    • We offer the following APIs:
      • count: A metric that increments counts
      • gauge: A metric that tracks a value that can go up or down
      • distribution: A metric that tracks the statistical distribution of values
    • For more details, see the Metrics documentation: https://docs.sentry.io/product/explore/metrics/getting-started/

8.29.0 (Stable)

16 Dec 08:30

Choose a tag to compare

Fixes

  • Support serialization of primitive arrays (boolean[], byte[], short[], char[], int[], long[], float[], double[]) (#4968)
  • Session Replay: Improve network body parsing and truncation handling (#4958)

Internal

  • Support metric envelope item type (#4956)