Skip to content

fix: MAUI - drop OTel activity instrumentation dependency#651

Open
abelonogov-ld wants to merge 1 commit into
mainfrom
fix/maui-remove-activity-instrumentation
Open

fix: MAUI - drop OTel activity instrumentation dependency#651
abelonogov-ld wants to merge 1 commit into
mainfrom
fix/maui-remove-activity-instrumentation

Conversation

@abelonogov-ld

Copy link
Copy Markdown
Contributor

Summary

  • Remove io.opentelemetry.android.instrumentation:activity:0.11.0-alpha (both implementation and copyDependencies) from the MAUI native Android module (LDObserve/build.gradle.kts), so the activity instrumentation AAR is no longer copied into the shipped NuGet deps.
  • Fix ObservabilityBridge, which still passed activityLifecycle = true to Instrumentations(...) — a parameter removed in feat: Android track API and productAnalytics options #577 (renamed to analytics.pageViews). This was a stale reference that no longer compiles against the current observability-android lib.
  • Since page views rely on the activity instrumentation AAR we no longer ship, explicitly set analytics.pageViews = false so the SDK calls suppressInstrumentation("activity") instead of relying on the instrumentation just being silently absent.

Notes

  • instrumentations.screens / userTaps are left at their defaults (true): screen detection and Session Replay navigation use Android's own registerActivityLifecycleCallbacks, not the OTel activity AAR, so they keep working.
  • observability-android/lib still declares the activity dependency (shared with Flutter); at runtime on MAUI the AAR simply won't be on the classpath and the suppressed instrumentation stays off.

Test plan

  • MAUI native Android Gradle module compiles (ObservabilityBridge no longer references the removed activityLifecycle param).
  • Verify the activity instrumentation AAR is absent from outputs/deps / the produced NuGet.
  • Smoke test a MAUI sample app: crash reporting + launch time + session replay navigation still function; no page-view spans emitted.

Made with Cursor

Remove the io.opentelemetry.android.instrumentation:activity:0.11.0-alpha
dependency from the MAUI native Android module so the AAR is no longer
copied into the shipped NuGet deps.

Also fix ObservabilityBridge, which still passed the long-removed
`activityLifecycle` argument to `Instrumentations(...)` (renamed to
`analytics.pageViews` in #577). Page views rely on the activity
instrumentation AAR we no longer ship, so set `analytics.pageViews = false`
to explicitly suppress that instrumentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abelonogov-ld abelonogov-ld requested a review from a team as a code owner June 25, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant