feat: MAUI integration hooks and refactor#425
Open
abelonogov-ld wants to merge 46 commits intomainfrom
Open
Conversation
* main: feat: Optional Jet Compose (#402) feat: Android Incremental Image Diff compression (#390) chore: add CLAUDE.md (#398) chore: release main (#400) fix: correct react native session replay build step (#399) chore: release main (#396) fix: Android span e2e tests (#397) fix: improve network response capture (#379) # Conflicts: # sdk/@launchdarkly/mobile-dotnet/.vscode/tasks.json
* main: chore: release main (#401)
(cherry picked from commit 9901600)
* andrey/hooks: comment identify stuff fat working working can launch
* main: fix: ldclient dependencies (#407)
* main: chore: release main (#419) feat: Use C and NEON for hashing (Optimization) 100x on Pixel 8 (#415) chore: release main (#418) feat: Android SR use Jpeg 0.3 quality (#417) chore: release main (#411) feat: CPU utilization optimization in image diff calculations (#414) fix: reset nodeIds during fullsnapshot (#412) chore: Android benchmark screen of SR data pipelines on iOS Raw Frames (#410) feat: Android Observability hook proxy for MAUI (#409) feat: ruby observability plugin (#360) # Conflicts: # sdk/@launchdarkly/mobile-dotnet/android/native/LDObserve/src/main/java/com/example/LDObserve/ObservabilityBridge.kt # sdk/@launchdarkly/mobile-dotnet/macios/native/LDObserve/Sources/ObservabilityBridge.swift # sdk/@launchdarkly/mobile-dotnet/observability/LDAPI/LDObserve.cs # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.Fat.csproj # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.csproj # sdk/@launchdarkly/mobile-dotnet/observability/bridge/LDObserve.cs # sdk/@launchdarkly/mobile-dotnet/observability/bridge/NativeHookProxy.cs # sdk/@launchdarkly/mobile-dotnet/observability/observe/api/LDObserve.cs # sdk/@launchdarkly/mobile-dotnet/observability/observe/plugin/ObservabilityHook.cs # sdk/@launchdarkly/mobile-dotnet/observability/observe/plugin/ObservabilityPlugin.cs # sdk/@launchdarkly/mobile-dotnet/observability/replay/plugin/SessionReplayHook.cs # sdk/@launchdarkly/mobile-dotnet/observability/replay/plugin/SessionReplayPlugin.cs # sdk/@launchdarkly/mobile-dotnet/sample/MauiProgram.cs
* main: feat: mobile-dotnet support init attributes (#420) # Conflicts: # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.Fat.csproj # sdk/@launchdarkly/mobile-dotnet/observability/LDObservability.csproj # sdk/@launchdarkly/mobile-dotnet/observability/bridge/DictionaryTypeConverters.cs
...ty-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/SessionReplayService.kt
Outdated
Show resolved
Hide resolved
...ib/src/main/kotlin/com/launchdarkly/observability/replay/exporter/SessionReplayApiService.kt
Outdated
Show resolved
Hide resolved
...ty-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/SessionReplayService.kt
Show resolved
Hide resolved
...ability-android/lib/src/main/kotlin/com/launchdarkly/observability/sdk/AttributeConverter.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| .anonymous(true) | ||
| .build() | ||
|
|
||
| //LDClient.get().identify(anonContext) |
There was a problem hiding this comment.
.../lib/src/main/kotlin/com/launchdarkly/observability/replay/exporter/SessionReplayExporter.kt
Show resolved
Hide resolved
(cherry picked from commit a56660e)
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.


Summary
Refactors the Android Observability SDK architecture to align with the iOS/Swift and MAUI integration patterns, decoupling the
Observabilityplugin fromSessionReplayso each can function independently.Architectural Changes
SessionReplayServicecan depend onObservability, butObservabilityno longer depends onSessionReplay. RemovedInstrumentationContributor,InstrumentationContributorManager, and theLDExtendedInstrumentation-based registration flow.ReplayInstrumentation→SessionReplayService,ReplayControl→SessionReplayServicing.RoutingLogRecordProcessorand the per-instrumentation log routing mechanism fromInstrumentationManager, since it was only used by session replay and no longer needed.InstrumentationManagernow captures the OTelSessionManagervia a lightweight bridgeAndroidInstrumentationand exposes it throughObservabilityClient→ObservabilityContext.sessionManager, matching the Swift pattern.Session Replay Changes
SessionReplay.register()directly createsSessionReplayServiceusingLDObserve.context, wires it toLDReplay, and sets the hook delegate.SessionReplay.onPluginsReady()callssessionReplayService.initialize()afterSessionManageris available.SessionReplayHookno longer holds a reference to theSessionReplayplugin. Instead, it uses a@Volatiledelegate of typeSessionReplayServicingand extracts context keys from SDK types before delegating.afterIdentifymoved to service layer: Context key extraction andLDContextbuilding now happen inSessionReplayService.afterIdentify()andSessionReplayHook.afterIdentify()respectively, using aMap<String, String>interface for cross-platform compatibility.SessionReplayHookProxy: JVM adapter for the C#/MAUI bridge that accepts simple JVM types and delegates toSessionReplayServicing.RRWebEventGenerator.generateWakeUpEvents()andSessionReplayExporter.wakeUpEvents()to re-trigger player playback after session resumption with a reload event and synthetic mouse interactions.RRWebEventGeneratornow accepts atitleparameter used in reload custom events, derived from the application name.New Utilities
AttributeConverter: Converts untypedMap<String, Any?>dictionaries (from bridge layers like .NET MAUI) into OTelAttributes, with support for nested map flattening via dot-separated keys and typed list handling.Note
Medium Risk
Moderate risk due to refactoring plugin wiring and telemetry/session replay initialization order, plus new replay export behavior (wake-up payloads) that changes network/event flow.
Overview
Refactors Android Observability + Session Replay integration to remove the
LDExtendedInstrumentation/InstrumentationContributor*registration path and instead expose the OTelSessionManagerfromInstrumentationManagerthroughObservabilityClientintoObservabilityContext, which Session Replay consumes.Session Replay is reworked into a standalone
SessionReplayServicethat is initialized ononPluginsReady, receives identify events via a delegate-basedSessionReplayHook(and newSessionReplayHookProxyfor MAUI), and updatesLDReplayto use a newSessionReplayServicinginterface.Replay export behavior changes by adding a title-aware
RRWebEventGeneratorand emitting an extra “wake up” payload (reload + synthetic interactions) after the first push to improve player resumption; also setsclient_idfor replay session init and adjusts identify event session selection when sessionId is missing.Adds MAUI-friendly observability APIs:
LDObserve.recordLog/recordErroroverloads plusAttributeConverterto turnMap<String, Any?>into OTelAttributes. Minor demo app UI tweaks (session replay header/toggle, label updates) and test updates/removals to match the new architecture.Written by Cursor Bugbot for commit 27d2002. This will update automatically on new commits. Configure here.