Skip to content

Releases: getsentry/sentry-java

8.3.0

26 Feb 14:08
Compare
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
Compare
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

11 Feb 16:22
Compare
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
Compare
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
Compare
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.

8.0.0

21 Jan 13:00
Compare
Choose a tag to compare

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

  • Hub has been replaced by Scopes
  • 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.
  • Bumping minSdk level to 21 (Android 5.0)
  • Our sentry-opentelemetry-agent has been improved and now works in combination with the rest of Sentry. You may now combine OpenTelemetry and Sentry for instrumenting your application.
    • You may now use both OpenTelemetry SDK and Sentry SDK to capture transactions and spans. They can also be mixed and end up on the same transaction.
    • OpenTelemetry extends the Sentry SDK by adding spans for numerous integrations, like Ktor, Vert.x and MongoDB. Please check the OpenTelemetry GitHub repository for a full list.
    • OpenTelemetry allows propagating trace information from and to additional libraries, that Sentry did not support before, for example gRPC.
    • OpenTelemetry also has broader support for propagating the Sentry Scopes (used to be Hub) through reactive libraries like RxJava.
  • The SDK is now compatible with Spring Boot 3.4
  • We now support GraphQL v22 (sentry-graphql-22)
  • Metrics have been removed

Please take a look at our migration guide in docs.

Sentry Self-hosted Compatibility

This SDK version is compatible with a self-hosted version of Sentry 22.12.0 or higher. If you are using an older version of self-hosted Sentry (aka onpremise), you will need to upgrade. If you're using sentry.io no action is required.

Breaking Changes

  • The Android minSdk level for all Android modules is now 21 (#3852)
  • The minSdk level for sentry-android-ndk changed from 19 to 21 (#3851)
  • Throw IllegalArgumentException when calling Sentry.init on Android (#3596)
  • Metrics have been removed from the SDK (#3774)
    • Metrics will return but we don't know in what exact form yet
  • enableTracing option (a.k.a enable-tracing) has been removed from the SDK (#3776)
    • Please set tracesSampleRate to a value >= 0.0 for enabling performance instead. The default value is null which means performance is disabled.
  • Replace synchronized methods and blocks with ReentrantLock (AutoClosableReentrantLock) (#3715)
    • If you are subclassing any Sentry classes, please check if the parent class used synchronized before. Please make sure to use the same lock object as the parent class in that case.
  • traceOrigins option (io.sentry.traces.tracing-origins in manifest) has been removed, please use tracePropagationTargets (io.sentry.traces.trace-propagation-targets in manifest`) instead (#3780)
  • profilingEnabled option (io.sentry.traces.profiling.enable in manifest) has been removed, please use profilesSampleRate (io.sentry.traces.profiling.sample-rate instead) instead (#3780)
  • shutdownTimeout option has been removed, please use shutdownTimeoutMillis instead (#3780)
  • profilingTracesIntervalMillis option for Android has been removed (#3780)
  • io.sentry.session-tracking.enable manifest option has been removed (#3780)
  • Sentry.traceHeaders() method has been removed, please use Sentry.getTraceparent() instead (#3718)
  • Sentry.reportFullDisplayed() method has been removed, please use Sentry.reportFullyDisplayed() instead (#3717)
  • User.other has been removed, please use data instead (#3780)
  • SdkVersion.getIntegrations() has been removed, please use getIntegrationSet instead (#3780)
  • SdkVersion.getPackages() has been removed, please use getPackageSet() instead (#3780)
  • Device.language has been removed, please use locale instead (#3780)
  • TraceContext.user and TraceContextUser class have been removed, please use userId on TraceContext instead (#3780)
  • TransactionContext.fromSentryTrace() has been removed, please use Sentry.continueTrace() instead (#3780)
  • SentryDataFetcherExceptionHandler has been removed, please use SentryGenericDataFetcherExceptionHandler in combination with SentryInstrumentation instead (#3780)
  • sentry-android-okhttp has been removed in favor of sentry-okhttp, removing android dependency from the module (#3510)
  • Contexts no longer extends ConcurrentHashMap, instead we offer a selected set of methods.
  • User segment has been removed (#3512)
  • One of the AndroidTransactionProfiler constructors has been removed, please use a different one (#3780)
  • Use String instead of UUID for SessionId (#3834)
    • The Session constructor now takes a String instead of a UUID for the sessionId parameter.
    • Session.getSessionId() now returns a String instead of a UUID.
  • All status codes below 400 are now mapped to SpanStatus.OK (#3869)
  • Change OkHttp sub-spans to span attributes (#3556)
    • This will reduce the number of spans created by the SDK
  • instrumenter option should no longer be needed as our new OpenTelemetry integration now works in combination with the rest of Sentry

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. It can be manipulated using Sentry.configureScope(ScopeType.CURRENT, (scope) -> { ... }).
  • 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 our 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 our migration guide.
  • Send file name and path only if isSendDefaultPii is true (#3919)
  • (Android) Enable Performance V2 by default (#3824)
    • With this change cold app start spans will include spans for ContentProviders, Application and Activity load.
  • (Android) Replace thread id with kernel thread id in span data (#3706)
  • (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native (#3189)
    • This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
    • Chec...
Read more

7.21.0-beta.1

20 Jan 16:19
Compare
Choose a tag to compare
7.21.0-beta.1 Pre-release
Pre-release

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

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

7.20.1 (Stable)

20 Jan 15:47
Compare
Choose a tag to compare

Behavioural Changes

  • The user ip-address is now only set to "{{auto}}" if sendDefaultPii is enabled (#4071)
    • This change gives you control over IP address collection directly on the client

8.0.0-rc.4

09 Jan 16:22
Compare
Choose a tag to compare
8.0.0-rc.4 Pre-release
Pre-release

Features

  • Enable ThreadLocalAccessor for Spring Boot 3 WebFlux by default (#4023)

Internal

  • Warm starts cleanup (#3954)

Dependencies

7.20.0 (Stable)

02 Jan 19:35
Compare
Choose a tag to compare

Features

  • Session Replay GA (#4017)

To enable Replay use the sessionReplay.sessionSampleRate or sessionReplay.onErrorSampleRate options.

import io.sentry.SentryReplayOptions
import io.sentry.android.core.SentryAndroid

SentryAndroid.init(context) { options ->
 
  options.sessionReplay.sessionSampleRate = 1.0
  options.sessionReplay.onErrorSampleRate = 1.0

  // To change default redaction behavior (defaults to true)
  options.sessionReplay.redactAllImages = true
  options.sessionReplay.redactAllText = true

  // To change quality of the recording (defaults to MEDIUM)
  options.sessionReplay.quality = SentryReplayOptions.SentryReplayQuality.MEDIUM // (LOW|MEDIUM|HIGH)
}

To learn more about Session Replay, visit the documentation page: https://docs.sentry.io/platforms/android/session-replay/

Fixes

  • Fix warm start detection (#3937)
  • Session Replay: Reduce memory allocations, disk space consumption, and payload size (#4016)
  • Session Replay: Do not try to encode corrupted frames multiple times (#4016)

Internal

  • Session Replay: Allow overriding SdkVersion for replay events (#4014)
  • Session Replay: Send replay options as tags (#4015)

Breaking changes

  • Session Replay options were moved from under experimental to the main options object (#4017)