github getsentry/sentry-java 8.0.0-beta.2

pre-release23 hours ago

Breaking Changes

  • 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.
  • 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 by opentelemetry-spring-boot-starter instead of GlobalOpenTelemetry
  • 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 to sentry-opentelemetry-bootstrap which is loaded into the bootstrap classloader (i.e. null) when our Java agent is used. The rest has been moved into sentry-opentelemetry-agentcustomization and is loaded into the agent classloader when our Java agent is used.
    • The sentry-opentelemetry-bootstrap and sentry-opentelemetry-agentcustomization modules can be used without the agent as well, in which case all classes are loaded into the application classloader. Check out our sentry-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.*
  • 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 on Sentry.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 via sentry.properties.
    • If both the param on Sentry.init and the option are set, the option will win. By default the option is set to null meaning whatever is passed to Sentry.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)

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 OpenTelemetry Context (#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).
  • 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.

Don't miss a new sentry-java release

NewReleases is sending notifications on new releases.