fix: [SDK-5006] shade OpenTelemetry to isolate host R8 - #2715
Draft
abdulraqeeb33 wants to merge 1 commit into
Draft
fix: [SDK-5006] shade OpenTelemetry to isolate host R8#2715abdulraqeeb33 wants to merge 1 commit into
abdulraqeeb33 wants to merge 1 commit into
Conversation
Relocate io.opentelemetry into com.onesignal.shaded.opentelemetry and embed it in the otel AAR so Gradle cannot unify OneSignal's 1.55 copy with a host BOM (e.g. Embrace 1.64). Drop io.opentelemetry consumer dontwarn rules that leaked into every library in the app. Co-authored-by: abdulraqeeb33 <abdulraqeeb33@users.noreply.github.com>
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)5/6 touched executable lines covered (83.3% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
|
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.
Description
One Line Summary
Relocate OpenTelemetry into a OneSignal-private package so host BOMs (e.g. Embrace 1.64) cannot break R8, without shipping
-dontwarn io.opentelemetry.**that would hide diagnostics for other libraries.Details
Motivation
Host apps that also pull OpenTelemetry (Embrace 9.1.0 → OTel BOM 1.64.0) Gradle-unify with OneSignal’s transitive OTel 1.55.0 +
opentelemetry-disk-buffering:1.51.0-alpha. That alpha still referencesExtendedLogRecordData, which 1.64 removed, so R8 fails with a missing class.Prior fixes added more consumer
-dontwarnrules (SDK-4820, jackson, AutoValue). Those do not scale: consumer rules are merged into the host R8 config, so-dontwarn io.opentelemetry.**suppresses missing-class errors for every other library in the app.Fixes #2714 (Linear SDK-5006).
Scope
:otelrelease AAR embeds relocatedcom.onesignal.shaded.opentelemetryand no longer publishesio.opentelemetry*Maven transitives.:otelAPI (IOtelOpenTelemetry) no longer exposes OpenTelemetry Java types, so:corecannot compile against them.-dontwarn io.grpc.**.Testing
Unit testing
:OneSignal:otel:checkOtelIsolationasserts the release AAR has shaded classes, no unshadedio/opentelemetry, andreleaseRuntimeClasspathhas noio.opentelemetry*artifacts. Wired intocheckand CIdemo-build.:otel/ ANR unit tests updated for the internal SDK telemetry interfaces.:app:assembleGmsRelease -PsimulateOtelClashforces host OTel 1.64 (the SDK-5006 regression).Manual testing
Minified GMS demo assemble with and without
-PsimulateOtelClash(R8). Device runtime of crash/log export against a host that also uses Embrace is still recommended before release.Affected code checklist
Checklist
Overview
Testing
Final pass