Skip to content

Releases: getsentry/sentry-java

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

7.22.3

17 Mar 14:31

Choose a tag to compare

Fixes

  • Reduce excessive CPU usage when serializing breadcrumbs to disk for ANRs (#4181)

8.4.0

14 Mar 10:42

Choose a tag to compare

Fixes

  • The SDK now handles null on many APIs instead of expecting a non null value (#4245)
    • Certain APIs like setTag, setData, setExtra, setContext previously caused a NullPointerException when invoked with either null key or value.
    • The SDK now tries to have a sane fallback when null is passed and no longer throws NullPointerException
    • If null is passed, the SDK will
      • do nothing if a null key is passed, returning null for non void methods
      • remove any previous value if the new value is set to null
  • Add support for setting in-app-includes/in-app-excludes via AndroidManifest.xml (#4240)
  • Modifications to OkHttp requests are now properly propagated to the affected span / breadcrumbs (#4238)
    • Please ensure the SentryOkHttpInterceptor is added last to your OkHttpClient, as otherwise changes to the Request by subsequent interceptors won't be considered
  • Fix "class ch.qos.logback.classic.spi.ThrowableProxyVO cannot be cast to class ch.qos.logback.classic.spi.ThrowableProxy" (#4206)
    • In this case we cannot report the Throwable to Sentry as it's not available
    • If you are using OpenTelemetry v1 OpenTelemetryAppender, please consider upgrading to v2
  • Pass OpenTelemetry span attributes into TracesSampler callback (#4253)
    • SamplingContext now has a getAttribute method that grants access to OpenTelemetry span attributes via their String key (e.g. http.request.method)
  • Fix AbstractMethodError when using SentryTraced for Jetpack Compose (#4255)
  • Assume http.client for span op if not a root span (#4257)
  • Avoid unnecessary copies when using CopyOnWriteArrayList (#4247)
    • This affects in particular SentryTracer.getLatestActiveSpan which would have previously copied all child span references. This may have caused OutOfMemoryError on certain devices due to high frequency of calling the method.

Features

  • The SDK now automatically propagates the trace-context to the native layer. This allows to connect errors on different layers of the application. (#4137)
  • Capture OpenTelemetry span events (#3564)
    • OpenTelemetry spans may have exceptions attached to them (openTelemetrySpan.recordException). We can now send those to Sentry as errors.
    • Set capture-open-telemetry-events=true in sentry.properties to enable it
    • Set sentry.capture-open-telemetry-events=true in Springs application.properties to enable it
    • Set sentry.captureOpenTelemetryEvents: true in Springs application.yml to enable it

Behavioural Changes

  • Use java.net.URI for parsing URLs in UrlUtils (#4210)
    • This could affect grouping for issues with messages containing URLs that fall in known corner cases that were handled incorrectly previously (e.g. email in URL path)

Internal

  • Also use port when checking if a request is made to Sentry DSN (#4231)
    • For our OpenTelemetry integration we check if a span is for a request to Sentry
    • We now also consider the port when performing this check

Dependencies

7.22.2

13 Mar 17:24

Choose a tag to compare

Fixes

  • Fix AbstractMethodError when using SentryTraced for Jetpack Compose (#4256)

7.22.1

10 Mar 20:33

Choose a tag to compare

Fixes

  • Fix Ensure app start type is set, even when ActivityLifecycleIntegration is not running (#4216)
  • Fix properly reset application/content-provider timespans for warm app starts (#4244)

8.3.0 (Stable)

26 Feb 14:08

Choose a tag to compare

Features

  • Add HTTP server request headers from OpenTelemetry span attributes to sentry request in payload (#4102)
    • You have to explicitly enable each header by adding it to the OpenTelemetry config
    • Please only enable headers you actually want to send to Sentry. Some may contain sensitive data like PII, cookies, tokens etc.
    • We are no longer adding request/response headers to contexts/otel/attributes of the event.
  • The ignoredErrors option is now configurable via the manifest property io.sentry.traces.ignored-errors (#4178)
  • A list of active Spring profiles is attached to payloads sent to Sentry (errors, traces, etc.) and displayed in the UI when using our Spring or Spring Boot integrations (#4147)
    • This consists of an empty list when only the default profile is active
  • Added enableTraceIdGeneration to the AndroidOptions. This allows Hybrid SDKs to "freeze" and control the trace and connect errors on different layers of the application (4188)
  • Move to a single NetworkCallback listener to reduce number of IPC calls on Android (#4164)
  • Add GraphQL Apollo Kotlin 4 integration (#4166)
  • Add support for async dispatch requests to Spring Boot 2 and 3 (#3983)
    • To enable it, please set sentry.keep-transactions-open-for-async-responses=true in application.properties or sentry.keepTransactionsOpenForAsyncResponses: true in application.yml
  • Add constructor to JUL SentryHandler for disabling external config (#4208)

Fixes

  • Filter strings that cannot be parsed as Regex no longer cause an SDK crash (#4213)
    • This was the case e.g. for ignoredErrors, ignoredTransactions and ignoredCheckIns
    • We now simply don't use such strings for Regex matching and only use them for String comparison
  • SentryOptions.setTracePropagationTargets is no longer marked internal (#4170)
  • 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)
  • Check tracePropagationTargets in OpenTelemetry propagator (#4191)
    • If a URL can be retrieved from OpenTelemetry span attributes, we check it against tracePropagationTargets before attaching sentry-trace and baggage headers to outgoing requests
    • If no URL can be retrieved we always attach the headers
  • Fix ignoredErrors, ignoredTransactions and ignoredCheckIns being unset by external options like sentry.properties or ENV vars (#4207)
    • Whenever parsing of external options was enabled (enableExternalConfiguration), which is the default for many integrations, the values set on SentryOptions passed to Sentry.init would be lost
    • Even if the value was not set in any external configuration it would still be set to an empty list

Behavioural Changes

  • The class io.sentry.spring.jakarta.webflux.ReactorUtils is now deprecated, please use io.sentry.reactor.SentryReactorUtils in the new sentry-reactor module instead (#4155)
    • The new module will be exposed as an api dependency when using sentry-spring-boot-jakarta (Spring Boot 3) or sentry-spring-jakarta (Spring 6).
      Therefore, if you're using one of those modules, changing your imports will suffice.

8.2.0

12 Feb 17:39

Choose a tag to compare

Breaking Changes

  • The Kotlin Language version is now set to 1.6 (#3936)

Features

  • Create onCreate and onStart spans for all Activities (#4025)
  • Add split apks info to the App context (#3193)
  • Expose new withSentryObservableEffect method overload that accepts SentryNavigationListener as a parameter (#4143)
    • This allows sharing the same SentryNavigationListener instance across fragments and composables to preserve the trace
  • (Internal) Add API to filter native debug images based on stacktrace addresses (#4089)
  • Propagate sampling random value (#4153)
    • The random value used for sampling traces is now sent to Sentry and attached to the baggage header on outgoing requests
  • Update sampleRate that is sent to Sentry and attached to the baggage header on outgoing requests (#4158)
    • If the SDK uses its sampleRate or tracesSampler callback, it now updates the sampleRate in Dynamic Sampling Context.

Fixes

  • Log a warning when envelope or items are dropped due to rate limiting (#4148)
  • Do not log if OtelContextScopesStorage cannot be found (#4127)
    • Previously java.lang.ClassNotFoundException: io.sentry.opentelemetry.OtelContextScopesStorage was shown in the log if the class could not be found.
    • This is just a lookup the SDK performs to configure itself. The SDK also works without OpenTelemetry.
  • Session Replay: Fix various crashes and issues (#4135)
    • Fix FileNotFoundException when trying to read/write .ongoing_segment file
    • Fix IllegalStateException when registering onDrawListener
    • Fix SIGABRT native crashes on Motorola devices when encoding a video
  • Mention javadoc and sources for published artifacts in Gradle .module metadata (#3936)
  • (Jetpack Compose) Modifier.sentryTag now uses Modifier.Node (#4029)
    • This allows Composables that use this modifier to be skippable

Dependencies

7.22.0 (Stable)

11 Feb 16:22

Choose a tag to compare

Fixes

  • Session Replay: Fix various crashes and issues (#4135)
    • Fix FileNotFoundException when trying to read/write .ongoing_segment file
    • Fix IllegalStateException when registering onDrawListener
    • Fix SIGABRT native crashes on Motorola devices when encoding a video
  • (Jetpack Compose) Modifier.sentryTag now uses Modifier.Node (#4029)
    • This allows Composables that use this modifier to be skippable

Features

  • (Internal) Add API to filter native debug images based on stacktrace addresses (#4159)

8.1.0

30 Jan 17:24

Choose a tag to compare

Features

  • Add options.ignoredErrors to filter out errors that match a certain String or Regex (#4083)
    • The matching is attempted on event.message, event.formatted, and {event.throwable.class.name}: {event.throwable.message}
    • Can be set in sentry.properties, e.g. ignored-errors=Some error,Another .*
    • Can be set in environment variables, e.g. SENTRY_IGNORED_ERRORS=Some error,Another .*
    • For Spring Boot, it can be set in application.properties, e.g. sentry.ignored-errors=Some error,Another .*
  • Log OpenTelemetry related Sentry config (#4122)

Fixes

  • Avoid logging an error when a float is passed in the manifest (#4031)
  • Add request details to transactions created through OpenTelemetry (#4098)
    • We now add HTTP request method and URL where Sentry expects it to display it in Sentry UI
  • Remove java.lang.ClassNotFoundException debug logs when searching for OpenTelemetry marker classes (#4091)
    • There was up to three of these, one for io.sentry.opentelemetry.agent.AgentMarker, io.sentry.opentelemetry.agent.AgentlessMarker and io.sentry.opentelemetry.agent.AgentlessSpringMarker.
    • These were not indicators of something being wrong but rather the SDK looking at what is available at runtime to configure itself accordingly.
  • Do not instrument File I/O operations if tracing is disabled (#4051)
  • Do not instrument User Interaction multiple times (#4051)
  • Speed up view traversal to find touched target in UserInteractionIntegration (#4051)
  • Reduce IPC/Binder calls performed by the SDK (#4058)

Behavioural Changes

  • Reduce the number of broadcasts the SDK is subscribed for (#4052)
    • Drop TempSensorBreadcrumbsIntegration
    • Drop PhoneStateBreadcrumbsIntegration
    • Reduce number of broadcasts in SystemEventsBreadcrumbsIntegration

Current list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the SystemEventsBreadcrumbsIntegration as follows:

SentryAndroid.init(context) { options ->
    options.integrations.removeAll { it is SystemEventsBreadcrumbsIntegration }
    options.integrations.add(SystemEventsBreadcrumbsIntegration(context, SystemEventsBreadcrumbsIntegration.getDefaultActions() + listOf(/* your custom actions */)))
}

If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.

  • Set mechanism type to suppressed for suppressed exceptions (#4125)
    • This helps to distinguish an exceptions cause from any suppressed exceptions in the Sentry UI

Dependencies

7.21.0

27 Jan 19:58

Choose a tag to compare

Fixes

  • Do not instrument File I/O operations if tracing is disabled (#4051)
  • Do not instrument User Interaction multiple times (#4051)
  • Speed up view traversal to find touched target in UserInteractionIntegration (#4051)
  • Reduce IPC/Binder calls performed by the SDK (#4058)

Behavioural Changes

  • (added in 7.20.1) The user ip-address is now only set to "{{auto}}" if sendDefaultPii is enabled (#4071)
  • Reduce the number of broadcasts the SDK is subscribed for (#4052)
    • Drop TempSensorBreadcrumbsIntegration
    • Drop PhoneStateBreadcrumbsIntegration
    • Reduce number of broadcasts in SystemEventsBreadcrumbsIntegration

Current list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the SystemEventsBreadcrumbsIntegration as follows:

SentryAndroid.init(context) { options ->
    options.integrations.removeAll { it is SystemEventsBreadcrumbsIntegration }
    options.integrations.add(SystemEventsBreadcrumbsIntegration(context, SystemEventsBreadcrumbsIntegration.getDefaultActions() + listOf(/* your custom actions */)))
}

If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.