Repository navigation
feat(android): upgrade to OTel Android 0.13 and OTel Java 1.52 - #799
Draft
abelonogov-ld wants to merge 10 commits into
Draft
abelonogov-ld wants to merge 10 commits into
abelonogov-ld wants to merge 10 commits into
Conversation
…ndled okio/okhttp - Bump OpenTelemetry Java 1.51.0 -> 1.66.0 and OpenTelemetry Android 0.11.0-alpha -> 1.7.0 in observability-android and the MAUI LDObserve native module; migrate to the split SessionProvider/SessionPublisher API, RumBuilder, and the new AttributeType.VALUE / ValueType.EMPTY cases. - Pin kotlinx-coroutines, kotlin-stdlib, androidx.core and okhttp to versions the current Kotlin 2.0.21 / AGP 8.x toolchain can build against. - Drop the Org.Jetbrains.Kotlinx.KotlinxSerializationJson NuGet dependency. Its JVM package injects a jar from a hardcoded Gradle cache path, which duplicated kotlinx.serialization.json classes in apps using Xamarin.KotlinX.Serialization.Json. - Relocate the okio and okhttp3 classes bundled in ldobserve-otel-bundle.jar under com.launchdarkly.sessionreplay.shaded so they no longer collide with Square.OkIO (R8 'defined multiple times' failure in Release builds, e.g. via Firebase). - Update NativeAndroidDeps.props globs for the renamed OTel Android 1.x artifacts. - Fix ObservabilityBridge for the pageViews -> screenViews rename. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add MauiSample10.csproj (net10.0-android/ios) sharing sources with MauiSample9, with isolated obj/bin paths. - Reference Xamarin.Firebase.Messaging/Analytics on Android as a standing check against the Square.OkIO / KotlinX duplicate-class conflicts (exercised by Release builds). - Guard CommunityToolkit.Maui Popup API differences (v11 vs v15) in DialogsPage. - Show platform, .NET runtime version and Debug/Release in the shell title. - Remove global.json so the .NET 10 SDK can build the tree. Co-authored-by: Cursor <cursoragent@cursor.com>
… consumer apps 0.11.1 raised Xamarin.AndroidX.Lifecycle.* floors to 2.11.0.1, which requires SavedState >= 1.5.0.1 and Collection.Jvm >= 1.6.0.1 and conflicts with our SavedState 1.3.1.1 / Collection 1.5.0.3 floors, producing NU1605 downgrade errors in MAUI apps (e.g. MauiPlanets on MAUI 9). Our Java only uses lifecycle APIs present in 2.9 (ProcessLifecycleOwner, DefaultLifecycleObserver), so go back to the 2.9.2.1 line MAUI itself ships. Stop suppressing NU1605/NU1608 in MauiSample10 so the sample catches this, and bump the package version to 0.11.2. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The okio/okhttp relocation is what fixes the R8 duplicate-class failure in Release, and it is independent of the OTel version: 0.10.2, which shipped on OTel 1.51, already bundles 433 unshaded okio/okhttp3 entries including the okio/-DeflaterSinkExtensions that R8 rejects. Upgrading to OTel Android 1.7 pulls androidx.core 1.19, androidx.lifecycle 2.11 and okhttp-android 5.4, which require compileSdk 36-37 and AGP 9.1. That breaks every native Android consumer still on AGP 8, including our own e2e app, and is a migration the Android owners should land on its own schedule. Reverts the version bumps and the observability-android changes that existed only to track the 1.x API. Keeps the relocation, the Lifecycle floors, the .NET 10 sample and the Analytics.screenViews fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Restores the upgrade that was split out of #791 so the MAUI Release fix could ship without it. Not ready to merge as-is. OTel Android 1.7 pulls androidx.core 1.19, androidx.lifecycle 2.11 and okhttp-android 5.4, which declare a minimum compileSdk of 36-37 and AGP 9.1. The e2e app (compileSdk 35, AGP 8.13.2) fails checkComposeDebugAarMetadata on them, and so will any consumer still on AGP 8. The resolutionStrategy pins in lib/build.gradle.kts only hold inside this build; they are not published, so consumers see the raw transitives. Landing this needs an AGP 9 / compileSdk 37 migration first, or a decision to pin the transitives in the published POM. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
OTel Android 1.7 forced consumers to compileSdk 37 / AGP 9.1, and 1.5+ needs Kotlin 2.3+. 0.13 is the last release whose transitives keep the floor at compileSdk 35 / AGP 8.6 (androidx.core 1.16). - Adapt to the 0.13 session API: SessionManager/SessionIdGenerator are gone, so LDSessionManager implements SessionProvider + SessionPublisher and is installed with the now-public OpenTelemetryRumBuilder.setSessionProvider, replacing LDRumSessionManagerAccessor. - Pin kotlin-stdlib to 2.0.21 in the MAUI LDObserve module, matching the lib. - e2e: align OTel versions and move OkHttp/MockWebServer to 5.1.0 (pulled by exporter-sender-okhttp 1.52); MockWebServer 5 records 127.0.0.1 as host. Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #791.
Summary
Upgrades OpenTelemetry Android from 0.11.0-alpha to 0.13.0-alpha, and OpenTelemetry Java from 1.51 to 1.52, in
observability-androidand in the MAUI native bridge.An earlier version of this PR went to OTel Android 1.7 / Java 1.66. That forced compileSdk 37 / AGP 9.1 on every native Android consumer, and Kotlin 2.3+ from OTel Android 1.5 onward. 0.13 is the newest release that keeps today's floor:
androidx.core(sets that floor)androidx.lifecyclekotlin-stdlibpulled by OTelFrom 0.14 on, OTel Android pulls
androidx.core1.17+, which needs compileSdk 36 / AGP 8.9.1.I checked the floor by reading the AAR metadata of every artifact on the library's release runtime classpath. The highest values are
minCompileSdk=35andminAgp=8.6.0.Code changes
SessionManagerandSessionIdGenerator; the session module now has onlySession,SessionObserver,SessionProviderandSessionPublisher.LDSessionManagernow implementsSessionProvider+SessionPublisher.OpenTelemetryRumBuilder.setSessionProvider, which is public in 0.13, soLDRumSessionManagerAccessor(the package-private workaround) is deleted.SessionManagernow take aSessionProvider.LDObserve/build.gradle.ktspinskotlin-stdlibto 2.0.21, matching whatobservability-android/libalready does. Without the pin, the module's Kotlin 2.0.21 compiler can't read the stdlib 2.2 metadata.opentelemetry-exporter-sender-okhttp1.52 pulls OkHttp 5 and the 4.x MockWebServer can't run on it.127.0.0.1, so the URL comparison helpers inDisablingConfigOptionsE2ETestnormalize it.The library's own runtime classpath stays on OkHttp 4.12. OkHttp 5 only comes in where the OTel OkHttp sender is used: in the e2e app, and shaded inside
ldobserve-otel-bundle.jarfor MAUI.Verification
:app:checkComposeDebugAarMetadata,:app:checkComposeReleaseAarMetadataand:app:assembleComposeReleasepass.:app:testComposeDebugUnitTestpasses 15 tests (1 skipped).:observability-android:testDebugUnitTestpasses 535 tests (2 skipped).LDObserve.Android.BindingRelease build passes.MauiSample10net10.0-android Release build passes with R8.telemetry.sdk.version1.52.0, and spans and logs carry the samesession.id.Notes
NativeAndroidDeps.props) is unchanged. 0.13 adds asessionsinstrumentation AAR, whichandroid-agentdepends on. Likecrashtoday, it isn't shipped. Instrumentations are discovered throughServiceLoader, so a missing AAR just means that instrumentation doesn't load, and no new session start/end events appear in MAUI apps.