Releases: getsentry/sentry-java
Releases · getsentry/sentry-java
7.20.0 (Stable)
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 mainoptions
object (#4017)
7.19.1
8.0.0-rc.3
Features
- Add
sentry-opentelemetry-agentless-spring
module (#4000)- This module can be added as a dependency when using Sentry with OpenTelemetry and Spring Boot but don't want to use our Agent. It takes care of configuring OpenTelemetry for use with Sentry.
- You may want to set
OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=none
env vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.
- Add
sentry-opentelemetry-agentless
module (#3961)- This module can be added as a dependency when using Sentry with OpenTelemetry but don't want to use our Agent. It takes care of configuring OpenTelemetry for use with Sentry.
- To enable the auto configuration of it, please set
-Dotel.java.global-autoconfigure.enabled=true
on thejava
command, when starting your application. - You may also want to set
OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=none
env vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.
OpenTelemetryUtil.applyOpenTelemetryOptions
now takes an enum instead of a boolean for its mode- Add
openTelemetryMode
option (#3994)- It defaults to
AUTO
meaning the SDK will figure out how to best configure itself for use with OpenTelemetry - Use of OpenTelemetry can also be disabled completely by setting it to
OFF
(#3995)- In this case even if OpenTelemetry is present, the Sentry SDK will not use it
- Use
AGENT
when usingsentry-opentelemetry-agent
- Use
AGENTLESS
when usingsentry-opentelemetry-agentless
- Use
AGENTLESS_SPRING
when usingsentry-opentelemetry-agentless-spring
- It defaults to
- Add
scopeBindingMode
toSpanOptions
(#4004)- This setting only affects the SDK when used with OpenTelemetry.
- Defaults to
AUTO
meaning the SDK will decide whether the span should be bound to the current scope. It will not bind transactions to scope usingAUTO
, it will only bind spans where the parent span is on the current scope. ON
sets the new span on the current scope.OFF
does not set the new span on the scope.
Fixes
- Replace deprecated
SimpleInstrumentation
withSimplePerformantInstrumentation
for graphql 22 (#3974) - Cache requests for Spring using Springs
ContentCachingRequestWrapper
instead of our own Wrapper to also cache parameters (#3641)- Previously only the body was cached which could lead to problems in the FilterChain as Request parameters were not available
- We now hold a strong reference to the underlying OpenTelemetry span when it is created through Sentry API (#3997)
- This keeps it from being garbage collected too early
- Close backpressure monitor on SDK shutdown (#3998)
- Due to the backpressure monitor rescheduling a task to run every 10s, it very likely caused shutdown to wait the full
shutdownTimeoutMillis
(defaulting to 2s) instead of being able to terminate immediately
- Due to the backpressure monitor rescheduling a task to run every 10s, it very likely caused shutdown to wait the full
- Improve ignored check performance (#3992)
- Checking if a span origin, a transaction or a checkIn should be ignored is now faster
7.19.0
Fixes
- Session Replay: fix various crashes and issues (#3970)
- Fix
IndexOutOfBoundsException
when tracking window changes - Fix
IllegalStateException
when adding/removing draw listener for a dead view - Fix
ConcurrentModificationException
when registering window listeners and stoppingWindowRecorder
/GestureRecorder
- Fix
- Add support for setting sentry-native handler_strategy (#3671)
Dependencies
8.0.0-rc.2
Fixes
- Fix incoming defer sampling decision
sentry-trace
header (#3942)- A
sentry-trace
header that only contains trace ID and span ID but no sampled flag (-1
,-0
suffix) means the receiving system can make its own sampling decision - When generating
sentry-trace
header fromPropagationContext
we now copy thesampled
flag. - In
TransactionContext.fromPropagationContext
when there is no parent sampling decision, keep the decisionnull
so a new sampling decision is made instead of defaulting tofalse
- A
- Defer sampling decision by setting
sampled
tonull
inPropagationContext
when using OpenTelemetry in case of an incoming defer samplingsentry-trace
header. (#3945) - Build
PropagationContext
fromSamplingDecision
made bySentrySampler
instead of parsing headers and potentially ignoring a sampling decision in case asentry-trace
header comes in with deferred sampling decision. (#3947) - Let OpenTelemetry handle extracting and injecting tracing information (#3953)
- Our integrations no longer call
.continueTrace
and also do not inject tracing headers if the integration has been added toignoredSpanOrigins
- Our integrations no longer call
- Changes up to
7.18.1
have been merged and are now included as well
8.0.0-rc.1
Features
- Extract OpenTelemetry
URL_PATH
span attribute into description (#3933) - Replace OpenTelemetry
ContextStorage
wrapper withContextStorageProvider
(#3938)- The wrapper had to be put in place before any call to
Context
whereasContextStorageProvider
is automatically invoked at the correct time.
- The wrapper had to be put in place before any call to
Dependencies
- Bump OpenTelemetry to 1.44.1, OpenTelemetry Java Agent to 2.10.0 and Semantic Conventions to 1.28.0 (#3935)
7.18.1 (Stable)
Fixes
- Fix testTag not working for Jetpack Compose user interaction tracking (#3878)
8.0.0-beta.3
Features
- Send
otel.kind
to Sentry (#3907) - Allow passing
environment
toCheckinUtils.withCheckIn
(3889) - Changes up to
7.18.0
have been merged and are now included as well
Fixes
- Mark
DiskFlushNotification
hint flushed when rate limited (#3892)- Our
UncaughtExceptionHandlerIntegration
waited for the full flush timeout duration (default 15s) when rate limited.
- Our
- Do not replace
op
with auto generated content for OpenTelemetry spans with span kindINTERNAL
(#3906)
Behavioural Changes
- Send file name and path only if isSendDefaultPii is true (#3919)
7.18.0 (Stable)
Features
- Android 15: Add support for 16KB page sizes (#3620)
- See https://developer.android.com/guide/practices/page-sizes for more details
- Session Replay: Add
beforeSendReplay
callback (#3855) - Session Replay: Add support for masking/unmasking view containers (#3881)
Fixes
- Avoid collecting normal frames (#3782)
- Ensure android initialization process continues even if options configuration block throws an exception (#3887)
- Do not report parsing ANR error when there are no threads (#3888)
- This should significantly reduce the number of events with message "Sentry Android SDK failed to parse system thread dump..." reported
- Session Replay: Disable replay in session mode when rate limit is active (#3854)
Dependencies
8.0.0-beta.2
Breaking Changes
- Use String instead of UUID for SessionId (#3834)
- The
Session
constructor now takes aString
instead of aUUID
for thesessionId
parameter. Session.getSessionId()
now returns aString
instead of aUUID
.
- The
- 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)
- All status codes below 400 are now mapped to
SpanStatus.OK
(#3869)
Features
- Spring Boot now automatically detects if OpenTelemetry is available and makes use of it (#3846)
- This is only enabled if there is no OpenTelemetry agent available
- We prefer to use the OpenTelemetry agent as it offers more auto instrumentation
- In some cases the OpenTelemetry agent cannot be used, please see https://opentelemetry.io/docs/zero-code/java/spring-boot-starter/ for more details on when to prefer the Agent and when the Spring Boot starter makes more sense.
- In this mode the SDK makes use of the
OpenTelemetry
bean that is created byopentelemetry-spring-boot-starter
instead ofGlobalOpenTelemetry
- Spring Boot now automatically detects our OpenTelemetry agent if its auto init is disabled (#3848)
- This means Spring Boot config mechanisms can now be combined with our OpenTelemetry agent
- The
sentry-opentelemetry-extra
module has been removed again, most classes have been moved tosentry-opentelemetry-bootstrap
which is loaded into the bootstrap classloader (i.e.null
) when our Java agent is used. The rest has been moved intosentry-opentelemetry-agentcustomization
and is loaded into the agent classloader when our Java agent is used. - The
sentry-opentelemetry-bootstrap
andsentry-opentelemetry-agentcustomization
modules can be used without the agent as well, in which case all classes are loaded into the application classloader. Check out oursentry-samples-spring-boot-jakarta-opentelemetry-noagent
sample. - In this mode the SDK makes use of
GlobalOpenTelemetry
- Automatically set span factory based on presence of OpenTelemetry (#3858)
SentrySpanFactoryHolder
has been removed as it is no longer required.
- Add
ignoredTransactions
option to filter out transactions by name (#3871)- can be used via ENV vars, e.g.
SENTRY_IGNORED_TRANSACTIONS=POST /person/,GET /pers.*
- can also be set in options directly, e.g.
options.setIgnoredTransactions(...)
- can also be set in
sentry.properties
, e.g.ignored-transactions=POST /person/,GET /pers.*
- can also be set in Spring config
application.properties
, e.g.sentry.ignored-transactions=POST /person/,GET /pers.*
- can be used via ENV vars, e.g.
- Add a sample for showcasing Sentry with OpenTelemetry for Spring Boot 3 with our Java agent (
sentry-samples-spring-boot-jakarta-opentelemetry
) (#3856) - Add a sample for showcasing Sentry with OpenTelemetry for Spring Boot 3 without our Java agent (
sentry-samples-spring-boot-jakarta-opentelemetry-noagent
) (#3856) - Add a sample for showcasing Sentry with OpenTelemetry (
sentry-samples-console-opentelemetry-noagent
) (#3856) - Add
globalHubMode
to options (#3805)globalHubMode
used to only be a param onSentry.init
. To make it easier to be used in e.g. Desktop environments, we now additionally added it as an option on SentryOptions that can also be set viasentry.properties
.- If both the param on
Sentry.init
and the option are set, the option will win. By default the option is set tonull
meaning whatever is passed toSentry.init
takes effect.
- Lazy uuid generation for SentryId and SpanId (#3770)
- Faster generation of Sentry and Span IDs (#3818)
- Uses faster implementation to convert UUID to SentryID String
- Uses faster Random implementation to generate UUIDs
- Android 15: Add support for 16KB page sizes (#3851)
- See https://developer.android.com/guide/practices/page-sizes for more details
Fixes
- The Sentry OpenTelemetry Java agent now makes sure Sentry
Scopes
storage is initialized even if the agents auto init is disabled (#3848)- This is required for all integrations to work together with our OpenTelemetry Java agent if its auto init has been disabled and the SDKs init should be used instead.
- Do not ignore certain span origins for OpenTelemetry without agent (#3856)
- Fix
startChild
for span that is not in current OpenTelemetryContext
(#3862)- Starting a child span from a transaction that wasn't in the current
Context
lead to multiple transactions being created (one for the transaction and another per span created).
- Starting a child span from a transaction that wasn't in the current
- Add
auto.graphql.graphql22
to ignored span origins when using OpenTelemetry (#3828) - The Spring Boot 3 WebFlux sample now uses our GraphQL v22 integration (#3828)
- All status codes below 400 are now mapped to
SpanStatus.OK
(#3869)
Dependencies
Behavioural Changes
- (Android) Enable Performance V2 by default (#3824)
- With this change cold app start spans will include spans for ContentProviders, Application and Activity load.