feat: MAUI Network tracing 0.8.0#463
Merged
abelonogov-ld merged 23 commits intomainfrom Apr 9, 2026
Merged
Conversation
- Introduced `triggerLogWithContext` method in ViewModel to log messages with OpenTelemetry span context. - Added a button in MainActivity to trigger the new logging functionality, enhancing observability in detached threads.
- Cleaned up imports in `LDObserve.kt`, `ObservabilityHookExporter.kt`, `ViewModel.kt`, `ObservabilityServiceTasks.kt`, `SamplingE2ETest.kt`, and `DisablingConfigOptionsE2ETest.kt` by removing the unused `recordLog` import. - Updated `recordLog` method signature in `Observe.kt` to provide default values for attributes and spanContext, simplifying its usage.
- Introduced a new button in MainPage.xaml to trigger logging with OpenTelemetry span context. - Implemented OnTriggerLogWithContextClicked method in MainPage.xaml.cs to log messages with associated span context. - Updated LDObserve to support optional span context in the RecordLog method, enhancing trace-log correlation capabilities.
…ization logic - Renamed the TryInitializeAll method to InitializeAll for clarity. - Updated the initialization logic to only call LDObserve.Initialize if observability options are enabled. - Adjusted the Register method to call the renamed InitializeAll method.
cd54e54 to
d21019e
Compare
- Introduced `triggerLogWithContext` method in ViewModel to log messages with OpenTelemetry span context. - Added a button in MainActivity to trigger the new logging functionality, enhancing observability in detached threads.
- Cleaned up imports in `LDObserve.kt`, `ObservabilityHookExporter.kt`, `ViewModel.kt`, `ObservabilityServiceTasks.kt`, `SamplingE2ETest.kt`, and `DisablingConfigOptionsE2ETest.kt` by removing the unused `recordLog` import. - Updated `recordLog` method signature in `Observe.kt` to provide default values for attributes and spanContext, simplifying its usage.
d21019e to
071345b
Compare
Vadman97
approved these changes
Apr 9, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 86839b9. Configure here.
Merged
abelonogov-ld
pushed a commit
that referenced
this pull request
Apr 10, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-observability-android: 0.37.0</summary> ## [0.37.0](launchdarkly-observability-android-0.36.0...launchdarkly-observability-android-0.37.0) (2026-04-09) ### Features * MAUI Network tracing 0.8.0 ([#463](#463)) ([0e2482b](0e2482b)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this PR only updates release/version metadata and the changelog, with no functional code changes. > > **Overview** > Bumps `sdk/@launchdarkly/observability-android` from `0.36.0` to `0.37.0` in the release manifest and Gradle properties. > > Updates `sdk/@launchdarkly/observability-android/CHANGELOG.md` with the `0.37.0` release entry (MAUI network tracing `0.8.0`). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 11a360d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
System.Net.HttpActivity source toLDTracerso HTTP requests made from .NET are automatically captured as spans. On iOS, nativeurlSessioninstrumentation is disabled since tracing now happens on the .NET side. On Android,UseNativeHttpHandleris set tofalsein the sample project soSocketsHttpHandleremits Activity diagnostics.InstrumentationOptions(withNetworkRequestsandLaunchTimestoggles) onObservabilityOptions, plumbed through the iOS (Swift) and Android (Kotlin) native bridges so each instrumentation can be individually enabled/disabled from the .NET layer.LDObserve.RecordLognow accepts an optionalSpanContext?parameter. When provided, its trace/span IDs are forwarded to the native logger; otherwise the ambientActivity.Currentis used. The native logger is obtained via newObjcLogger(iOS) andRealLogger(Android) bridge classes, replacing the oldrecordLogmethod onObservabilityBridge.LDObserve:RecordError(Exception),StartRootSpan(string), andGetTracer()(with no-op fallback before init).TracesApi.startSpannow defaultsattributestoAttributes.empty().ViewModeldemonstrates parent/child span creation and cross-thread context propagation.LaunchDarkly.SessionReplay0.6.0 → 0.8.0.Changes by area
.NET SDK (
mobile-dotnet/observability)InstrumentationOptionsclass withNetworkRequestsandLaunchTimesbooleans (defaulttrue), added toObservabilityOptions.ObservabilityPluginenablesSystem.Net.Http.EnableActivityPropagationwhen network request tracing is on.LDTraceris no longer a singleton; acceptsserviceNameandnetworkRequestsparams; conditionally subscribes toSystem.Net.HttpActivity source.ObservabilityServiceconsolidates all bridge calls, tracer lifecycle, and native logger acquisition. Replaces deletedNativeObserve.LDObserveis now a thin static facade overObservabilityService; safe to call before initialization (no-ops).PluginOrchestratorrenamed properties toObservabilityService/SessionReplayService; callsLDObserve.Initialize()after native start.LDNative.Android.cs,SRClient.iOS.cs) pass new instrumentation options through.Native bridges — iOS (Swift)
ObjcObservabilityOptionsaddsnetworkRequestsandlaunchTimesproperties.ObservabilityBridgedisablesurlSessioninstrumentation and makeslaunchTimesconfigurable.ObjcLoggerclass exposed viaLDObserveBridge.getObjcLogger().ApiDefinition.csupdated with new properties andObjcLoggerinterface.Native bridges — Android (Kotlin)
LDObservabilityOptionsaddslaunchTimefield; options classes moved toOptionsBridge.kt.ObservabilityBridgereadslaunchTimefrom options instead of hardcodingtrue;recordLogremoved.RealLoggerwrapper aroundKotlinLoggerfor C# binding.LDObserveBridgeAdapterexposesgetLogger().Android SDK (
observability-android)TracesApi.startSpanparameterattributesnow defaults toAttributes.empty().E2E / Sample
ViewModeldemonstrates parent-child span creation and cross-thread context propagation.MauiProgram.csuses the newInstrumentationOptionsAPI..csprojsetsUseNativeHttpHandler=falsefor Android to enableSystem.Net.HttpActivity diagnostics.Note
Medium Risk
Touches cross-platform observability initialization and tracing sources (including automatic
System.Net.Httpspan capture), so misconfiguration could change telemetry volume/correlation or miss spans on iOS/Android.Overview
Adds automatic .NET MAUI HTTP request tracing by extending
LDTracerto optionally subscribe to theSystem.Net.HttpActivity source and enablingSystem.Net.Http.EnableActivityPropagationwhen configured.Introduces
InstrumentationOptionsonObservabilityOptions(toggles forNetworkRequestsandLaunchTimes) and plumbs these through the Android (Kotlin) and iOS (Swift + binding) native bridges; iOS disables nativeurlSessiontracing in favor of .NET-side tracing, and Android bridge now respects a configurablelaunchTimeflag.Hardens initialization by making
PluginOrchestratorinitialize only once, updates samples/e2e to demonstrate cross-thread span context propagation and config usage (including AndroidUseNativeHttpHandler=false), and bumpsLaunchDarkly.SessionReplaypackage version to0.8.0.Reviewed by Cursor Bugbot for commit abda519. Bugbot is set up for automated code reviews on this repo. Configure here.