-
-
Notifications
You must be signed in to change notification settings - Fork 226
chore(deps): update Java SDK to v8.3.0 #3911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b7a2d10 to
ce1e33f
Compare
ce1e33f to
7497ace
Compare
3e890be to
95ceccd
Compare
6246f13 to
f3f8a8c
Compare
f3f8a8c to
9ad5f5d
Compare
0cc25d8 to
6972787
Compare
3fc49c1 to
888c258
Compare
888c258 to
b22f647
Compare
556817c to
9b9b30f
Compare
9b9b30f to
d0b28cd
Compare
@aritchie I think you're handier than I am where bindings are concerned. Is this something you reckon you'd be able to tackle? |
@jamescrosswell @aritchie any chance either of you guys can help with this? |
|
@bruno-garcia @jamescrosswell James & I did discuss. This isn't a small sum of work. I think we also need to consider breaking changes that could come from updating to this. |
|
I'll take a stab at this. |
|
Replaced by #4075: |
Bumps scripts/update-java.ps1 from 7.20.1 to 8.3.0.
Auto-generated by a dependency updater.
Changelog
8.3.0
Features
requestin payload (#4102)contexts/otel/attributesof the event.ignoredErrorsoption is now configurable via the manifest propertyio.sentry.traces.ignored-errors(#4178)enableTraceIdGenerationto the AndroidOptions. This allows Hybrid SDKs to "freeze" and control the trace and connect errors on different layers of the application (4188)sentry.keep-transactions-open-for-async-responses=trueinapplication.propertiesorsentry.keepTransactionsOpenForAsyncResponses: trueinapplication.ymlSentryHandlerfor disabling external config (#4208)Fixes
ignoredErrors,ignoredTransactionsandignoredCheckInsSentryOptions.setTracePropagationTargetsis no longer marked internal (#4170)tracePropagationTargetsin OpenTelemetry propagator (#4191)tracePropagationTargetsbefore attachingsentry-traceandbaggageheaders to outgoing requestsignoredErrors,ignoredTransactionsandignoredCheckInsbeing unset by external options likesentry.propertiesor ENV vars (#4207)enableExternalConfiguration), which is the default for many integrations, the values set onSentryOptionspassed toSentry.initwould be lostBehavioural Changes
io.sentry.spring.jakarta.webflux.ReactorUtilsis now deprecated, please useio.sentry.reactor.SentryReactorUtilsin the newsentry-reactormodule instead (#4155)apidependency when usingsentry-spring-boot-jakarta(Spring Boot 3) orsentry-spring-jakarta(Spring 6).Therefore, if you're using one of those modules, changing your imports will suffice.
8.2.0
Breaking Changes
Features
Appcontext (#3193)withSentryObservableEffectmethod overload that acceptsSentryNavigationListeneras a parameter (#4143)SentryNavigationListenerinstance across fragments and composables to preserve the tracebaggageheader on outgoing requestssampleRatethat is sent to Sentry and attached to thebaggageheader on outgoing requests (#4158)sampleRateortracesSamplercallback, it now updates thesampleRatein Dynamic Sampling Context.Fixes
OtelContextScopesStoragecannot be found (#4127)java.lang.ClassNotFoundException: io.sentry.opentelemetry.OtelContextScopesStoragewas shown in the log if the class could not be found.FileNotFoundExceptionwhen trying to read/write.ongoing_segmentfileIllegalStateExceptionwhen registeringonDrawListener.modulemetadata (#3936)Dependencies
8.1.0
Features
options.ignoredErrorsto filter out errors that match a certain String or Regex (#4083)event.message,event.formatted, and{event.throwable.class.name}: {event.throwable.message}sentry.properties, e.g.ignored-errors=Some error,Another .*SENTRY_IGNORED_ERRORS=Some error,Another .*application.properties, e.g.sentry.ignored-errors=Some error,Another .*Fixes
requestdetails to transactions created through OpenTelemetry (#4098)java.lang.ClassNotFoundExceptiondebug logs when searching for OpenTelemetry marker classes (#4091)io.sentry.opentelemetry.agent.AgentMarker,io.sentry.opentelemetry.agent.AgentlessMarkerandio.sentry.opentelemetry.agent.AgentlessSpringMarker.UserInteractionIntegration(#4051)Behavioural Changes
TempSensorBreadcrumbsIntegrationPhoneStateBreadcrumbsIntegrationSystemEventsBreadcrumbsIntegrationCurrent list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the
SystemEventsBreadcrumbsIntegrationas follows:If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.
typetosuppressedfor suppressed exceptions (#4125)Dependencies
3.4.2(#4081)8.0.0
Summary
Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
Hubhas been replaced byScopesScopetypes have been introduced, see "Behavioural Changes" for more details.Scopelifecycle, see "Behavioural Changes" for more details.minSdklevel to 21 (Android 5.0)sentry-opentelemetry-agenthas been improved and now works in combination with the rest of Sentry. You may now combine OpenTelemetry and Sentry for instrumenting your application.Scopesthrough reactive libraries like RxJava.sentry-graphql-22)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.0or higher. If you are using an older version of self-hosted Sentry (aka onpremise), you will need to upgrade. If you're usingsentry.iono action is required.Breaking Changes
enableTracingoption (a.k.aenable-tracing) has been removed from the SDK (#3776)tracesSampleRateto a value >= 0.0 for enabling performance instead. The default value isnullwhich means performance is disabled.synchronizedmethods and blocks withReentrantLock(AutoClosableReentrantLock) (#3715)synchronizedbefore. Please make sure to use the same lock object as the parent class in that case.traceOriginsoption (io.sentry.traces.tracing-originsin manifest) has been removed, please usetracePropagationTargets(io.sentry.traces.trace-propagation-targetsin manifest`) instead (#3780)profilingEnabledoption (io.sentry.traces.profiling.enablein manifest) has been removed, please useprofilesSampleRate(io.sentry.traces.profiling.sample-rateinstead) instead (#3780)shutdownTimeoutoption has been removed, please useshutdownTimeoutMillisinstead (#3780)profilingTracesIntervalMillisoption for Android has been removed (#3780)io.sentry.session-tracking.enablemanifest option has been removed (#3780)Sentry.traceHeaders()method has been removed, please useSentry.getTraceparent()instead (#3718)Sentry.reportFullDisplayed()method has been removed, please useSentry.reportFullyDisplayed()instead (#3717)User.otherhas been removed, please usedatainstead (#3780)SdkVersion.getIntegrations()has been removed, please usegetIntegrationSetinstead (#3780)SdkVersion.getPackages()has been removed, please usegetPackageSet()instead (#3780)Device.languagehas been removed, please uselocaleinstead (#3780)TraceContext.userandTraceContextUserclass have been removed, please useuserIdonTraceContextinstead (#3780)TransactionContext.fromSentryTrace()has been removed, please useSentry.continueTrace()instead (#3780)SentryDataFetcherExceptionHandlerhas been removed, please useSentryGenericDataFetcherExceptionHandlerin combination withSentryInstrumentationinstead (#3780)sentry-android-okhttphas been removed in favor ofsentry-okhttp, removing android dependency from the module (#3510)Contextsno longer extendsConcurrentHashMap, instead we offer a selected set of methods.AndroidTransactionProfilerconstructors has been removed, please use a different one (#3780)Sessionconstructor now takes aStringinstead of aUUIDfor thesessionIdparameter.Session.getSessionId()now returns aStringinstead of aUUID.SpanStatus.OK(#3869)instrumenteroption should no longer be needed as our new OpenTelemetry integration now works in combination with the rest of SentryBehavioural Changes
Scopetypes 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. SinceHubis 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.Sentry.inithas been called. It can be manipulated usingSentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... }).Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... }). The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, SpringAsyncand more.Sentry.configureScope(ScopeType.CURRENT, (scope) -> { ... }).Sentry.popScopehas been deprecated, please call.close()on the token returned bySentry.pushScopeinstead or use it in a way described in more detail in our migration guide.Sentry.configureScope()as well as API likeSentry.setTag()CURRENTscopeISOLATIONscopeScopecan now be ordered by overriding thegetOrdermethod on implementations ofEventProcessor. NOTE: This order only applies to event processors onScopebut notSentryOptionsat the moment. Feel free to request this if you need it.Hubis deprecated in favor ofScopes, alongside someHubrelevant APIs. More details can be found in our migration guide.isSendDefaultPiiistrue(#3919)sentry-samples/sentry-samples-androidexample on how to configure CMake and consumesentry.h"{{auto}}"ifsendDefaultPiiis enabled (#4072)Features
sentry-opentelemetry-agenthas been completely reworked and now plays nicely with the rest of the Java SDKScopes(used to beHub) propagation as well as performance instrumentation (i.e. more spans).OtelSpanFactoryinstead ofDefaultSpanFactorywhich is done automatically by the auto init of the Java Agent.Samplerwhich uses Sentry sampling configurationContextfor storing SentryScopes(which is similar to what used to be calledHub) and thus relies on OpenTelemetry forContextpropagation.sentry-opentelemetry-agentless-springmodule (#4000)OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=noneenv vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.sentry-opentelemetry-agentlessmodule (#3961)-Dotel.java.global-autoconfigure.enabled=trueon thejavacommand, when starting your application.OTEL_LOGS_EXPORTER=none;OTEL_METRICS_EXPORTER=none;OTEL_TRACES_EXPORTER=noneenv vars to not have the log flooded with error messages regarding OpenTelemetry features we don't use.OpenTelemetryUtil.applyOpenTelemetryOptionsnow takes an enum instead of a boolean for its modeopenTelemetryModeoption (#3994)AUTOmeaning the SDK will figure out how to best configure itself for use with OpenTelemetryOFF(#3995)AGENTwhen usingsentry-opentelemetry-agentAGENTLESSwhen usingsentry-opentelemetry-agentlessAGENTLESS_SPRINGwhen usingsentry-opentelemetry-agentless-springignoredTransactionsoption to filter out transactions by name (#3871)SENTRY_IGNORED_TRANSACTIONS=POST /person/,GET /pers.*options.setIgnoredTransactions(...)sentry.properties, e.g.ignored-transactions=POST /person/,GET /pers.*application.properties, e.g.sentry.ignored-transactions=POST /person/,GET /pers.*scopeBindingModetoSpanOptions(#4004)AUTOmeaning 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.ONsets the new span on the current scope.OFFdoes not set the new span on the scope.ignoredSpanOriginsoption for ignoring spans coming from certain integrationsgraphql-javav22 via a new modulesentry-graphql-22(#3740)graphql-javav21 or earlier, you can use thesentry-graphqlmodulegraphql-javav22 and newer please use thesentry-graphql-22moduleSentryInstrumenterbean directly for Spring (Boot) if there is none yet instead of usingGraphQlSourceBuilderCustomizerto add the instrumentation (#3744)SentryGraphqlInstrumentation.BeforeSpanCallbackwhich is then used bySentryInstrumenterThreadLocalAccessorfor Spring Boot 3 WebFlux by default (#4023)environmenttoCheckinUtils.withCheckIn(3889)globalHubModeto options (#3805)globalHubModeused 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.Sentry.initand the option are set, the option will win. By default the option is set tonullmeaning whatever is passed toSentry.inittakes effect.forceInit=true(force-initfor.propertiesfiles) to ensure a call to Sentry.init / SentryAndroid.init takes effect<meta-data android:name="io.sentry.force-init" android:value="true" />to ensure Sentry Android auto init is not easily overwrittenapplication/x-www-form-urlencodedrequests in Spring (#3731)application/jsonrequeststransaction.datainextrasanymoresentry-samples-spring-boot-jakarta-opentelemetry) (#3856)sentry-samples-spring-boot-jakarta-opentelemetry-noagent) (#3856)sentry-samples-console-opentelemetry-noagent) (#3856)Fixes
sentry-traceheader (#3942)sentry-traceheader that only contains trace ID and span ID but no sampled flag (-1,-0suffix) means the receiving system can make its own sampling decisionsentry-traceheader fromPropagationContextwe now copy thesampledflag.TransactionContext.fromPropagationContextwhen there is no parent sampling decision, keep the decisionnullso a new sampling decision is made instead of defaulting tofalsecloseon previous Sentry instance when re-initializing (#3750)SpanStatus.OK(#3869)ContentCachingRequestWrapperinstead of our own Wrapper to also cache parameters (#3641)shutdownTimeoutMillis(defaulting to 2s) instead of being able to terminate immediately.continueTraceand also do not inject tracing headers if the integration has been added toignoredSpanOriginsDiskFlushNotificationhint flushed when rate limited (#3892)UncaughtExceptionHandlerIntegrationwaited for the full flush timeout duration (default 15s) when rate limited.opwith auto generated content for OpenTelemetry spans with span kindINTERNAL(#3906)enable-spotlightandspotlight-connection-urlto external options and check if spotlight is enabled when deciding whether to inspect an OpenTelemetry span for connecting to splotlight (#3709)Contexts.setTracehas been markedNotNull(#3721)nullwould cause an exception.SpanOptions(#3722)SentryLogbackInitializeris now public (#3723)send-default-piiandmax-request-body-sizefromsentry.properties(#3534)TracesSampleris now only created once inSentryOptionsinstead of creating a new one for everyHub(which is nowScopes). This means we're now creating fewerSecureRandominstances.Internal
SentryClientconstructor public (#4045)Changes in pre-releases
These changes have been made during development of
8.0.0. You may skip this section. We just put it here for sake of completeness.Extract OpenTelemetry
URL_PATHspan attribute into description (#3933)Replace OpenTelemetry
ContextStoragewrapper withContextStorageProvider(#3938)ContextwhereasContextStorageProvideris automatically invoked at the correct time.Send
otel.kindto Sentry (#3907)Spring Boot now automatically detects if OpenTelemetry is available and makes use of it (#3846)
OpenTelemetrybean that is created byopentelemetry-spring-boot-starterinstead ofGlobalOpenTelemetrySpring Boot now automatically detects our OpenTelemetry agent if its auto init is disabled (#3848)
sentry-opentelemetry-extramodule has been removed again, most classes have been moved tosentry-opentelemetry-bootstrapwhich is loaded into the bootstrap classloader (i.e.null) when our Java agent is used. The rest has been moved intosentry-opentelemetry-agentcustomizationand is loaded into the agent classloader when our Java agent is used.sentry-opentelemetry-bootstrapandsentry-opentelemetry-agentcustomizationmodules 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-noagentsample.GlobalOpenTelemetryAutomatically set span factory based on presence of OpenTelemetry (#3858)
SentrySpanFactoryHolderhas been removed as it is no longer required.Replace deprecated
SimpleInstrumentationwithSimplePerformantInstrumentationfor graphql 22 (#3974)We now hold a strong reference to the underlying OpenTelemetry span when it is created through Sentry API (#3997)
Defer sampling decision by setting
sampledtonullinPropagationContextwhen using OpenTelemetry in case of an incoming defer samplingsentry-traceheader. (#3945)Build
PropagationContextfromSamplingDecisionmade bySentrySamplerinstead of parsing headers and potentially ignoring a sampling decision in case asentry-traceheader comes in with deferred sampling decision. (#3947)The Sentry OpenTelemetry Java agent now makes sure Sentry
Scopesstorage is initialized even if the agents auto init is disabled (#3848)Fix
startChildfor span that is not in current OpenTelemetryContext(#3862)Contextlead to multiple transactions being created (one for the transaction and another per span created).Add
auto.graphql.graphql22to ignored span origins when using OpenTelemetry (#3828)Use OpenTelemetry span name as fallback for transaction name (#3557)
Add OpenTelemetry span data to Sentry span (#3593)
No longer selectively copy OpenTelemetry attributes to Sentry spans / transactions
data(#3663)Remove
PROCESS_COMMAND_ARGS(process.command_args) OpenTelemetry span attribute as it can be very large (#3664)Use RECORD_ONLY sampling decision if performance is disabled (#3659)
Sentry OpenTelemetry Java Agent now sets Instrumenter to SENTRY (used to be OTEL) (#3697)
Set span origin in
ActivityLifecycleIntegrationon span options instead of after creating the span / transaction (#3702)Honor ignored span origins in
SentryTracer.startChild(#3704)Use span id of remote parent (#3548)
Attach active span to scope when using OpenTelemetry (#3549)
Record dropped spans in client report when sampling out OpenTelemetry spans (#3552)
Retrieve the correct current span from
Scope/Scopeswhen using OpenTelemetry (#3554)Support spans that are split into multiple batches (#3539)
Partially fix bootstrap class loading (#3543)
Scopesbeing active inside each OpenTelemetryContextdue to using context keys from more than one class loader.The Spring Boot 3 WebFlux sample now uses our GraphQL v22 integration (#3828)
Do not ignore certain span origins for OpenTelemetry without agent (#3856)
span.startChildnow uses.makeCurrent()by default (#3544)Do not set the exception group marker when there is a suppressed exception (#4056)
Dependencies
Migration Guide / Deprecations
Please take a look at our migration guide in docs.
Hubhas been deprecated, we're replacing the following:IHubhas been replaced byIScopes, however you should be able to simply passIHubinstances to code expectingIScopes, allowing for an easier migration.HubAdapter.getInstance()has been replaced byScopesAdapter.getInstance().clone()method onIHub/IScopeshas been deprecated, please use.pushScope()or.pushIsolationScope()instead.getCurrentHub()and.setCurrentHub()have also been replaced.Sentry.popScopehas been replaced by calling.close()on the token returned bySentry.pushScope()andSentry.pushIsolationScope(). The token can also be used in atryblock like this:as well as:
SentrySpanProcessor,SentryPropagator,OpenTelemetryLinkErrorEventProcessor). Please take a look at docs on how to setup OpenTelemetry in v8.You may also use
LifecycleHelper.close(token), e.g. in case you need to pass the token around for closing later.Changes from
rc.4If you have been using
8.0.0-rc.4of the Java SDK, here's the new changes that have been included in the8.0.0release:SentryClientconstructor public (#4045)"{{auto}}"if sendDefaultPii is enabled (#4072)7.21.0
Fixes
UserInteractionIntegration(#4051)Behavioural Changes
"{{auto}}"if sendDefaultPii is enabled (#4071)TempSensorBreadcrumbsIntegrationPhoneStateBreadcrumbsIntegrationSystemEventsBreadcrumbsIntegrationCurrent list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the
SystemEventsBreadcrumbsIntegrationas follows:If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.
7.21.0-beta.1
Fixes
UserInteractionIntegration(#4051)Behavioural Changes
TempSensorBreadcrumbsIntegrationPhoneStateBreadcrumbsIntegrationSystemEventsBreadcrumbsIntegrationCurrent list of the broadcast events can be found here. If you'd like to subscribe for more events, consider overriding the
SystemEventsBreadcrumbsIntegrationas follows:If you would like to keep some of the default broadcast events as breadcrumbs, consider opening a GitHub issue.