Skip to content

feat: Support Traces, Logs, Metrics in mobile dotnet 0.5.0#428

Merged
abelonogov-ld merged 104 commits into
mainfrom
andrey/dotnet-traces
Mar 27, 2026
Merged

feat: Support Traces, Logs, Metrics in mobile dotnet 0.5.0#428
abelonogov-ld merged 104 commits into
mainfrom
andrey/dotnet-traces

Conversation

@abelonogov-ld
Copy link
Copy Markdown
Contributor

@abelonogov-ld abelonogov-ld commented Mar 24, 2026

Summary

Summary: This PR adds distributed tracing support to the .NET MAUI and Android SDKs, refactors the plugin initialization architecture, expands the LDObserve public API with full Android implementation, and significantly improves the README documentation.

Architecture Overview

The tracing pipeline works as follows:

C# side: LDObserve.StartActiveSpan() creates .NET Activity objects via an OpenTelemetry TracerProvider (LDTracer singleton)
Export: LDTraceExporter catches completed spans and forwards them to TraceBuilderAdapter
Bridge: TraceBuilderAdapter calls the native tracer (iOS ObjcTracer / Android KotlinTracer) to re-create the span natively with the same trace/span/parent IDs and timestamps
Android ID mapping: Since OTel Java auto-generates new IDs, KotlinTracer stashes the C#-supplied IDs as __bridge.trace_id / __bridge.span_id attributes, and SamplingTraceExporter.applyBridgeIdOverrides() swaps them in before export

How did you test this change?

Are there any deployment considerations?


Note

High Risk
Medium-to-high risk: introduces new cross-language tracing pipeline (OpenTelemetry exporter + native span recreation/ID overrides) and refactors plugin initialization and hook wiring across Android/iOS, which can affect telemetry correctness and startup sequencing.

Overview
Adds full Observability support to the .NET MAUI SDK: LDObserve now records logs/errors/metrics on Android as well as iOS, and introduces a new OpenTelemetry-based tracing path (LDTracer + LDTraceExporter) that forwards completed .NET spans to native tracers on iOS/Android.

Refactors native plugin startup and hook wiring: replaces NativePluginConnector with PluginOrchestrator, splits observability vs session-replay hook export (NativeObservabilityHookExporter / NativeSessionReplayHookExporter), and updates native bridges (new Android LDObserveBridgeAdapter, new Kotlin bridge package/classes, iOS binding additions) to expose hook proxies + tracer builders.

Updates packaging/docs/samples: bumps mobile-dotnet version to 0.5.0, adds OpenTelemetry and newer LaunchDarkly.ClientSdk deps, enables Android metrics by default, updates README from “Session Replay” to “Observability”, and expands the MAUI sample with new trace/log demos and a DialogsPage plus extra UI dependencies.

Written by Cursor Bugbot for commit 65bf8e3. This will update automatically on new commits. Configure here.

* 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
(cherry picked from commit f883e975ca79da891b4178d8a12e27868f0931eb)
* main:
  chore: release main (#401)
(cherry picked from commit 9901600)
* main:
  chore: release main (#406)
  feat: Make Android SDK35 compilable (#405)
* andrey/hooks:
  comment identify stuff
  fat working
  working
  can launch
Comment thread e2e/android/app/src/main/java/com/example/androidobservability/BaseApplication.kt Outdated
Comment thread e2e/android/app/src/main/java/com/example/androidobservability/BaseApplication.kt Outdated
# Conflicts:
#	sdk/@launchdarkly/mobile-dotnet/observability/bridge/LDViewExtensions.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/observe/api/LDViewExtensions.cs
#	sdk/@launchdarkly/mobile-dotnet/observability/replay/api/LDViewExtensions.cs
#	sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/client/InstrumentationManager.kt
#	sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/client/ObservabilityClient.kt
#	sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/plugin/Observability.kt
#	sdk/@launchdarkly/observability-android/lib/src/test/kotlin/com/launchdarkly/observability/sdk/AttributeConverterTest.kt
@abelonogov-ld abelonogov-ld changed the title WIP Traces feat: Support Traces, Logs, Metrics in mobile dotnet Mar 26, 2026
@abelonogov-ld abelonogov-ld changed the title feat: Support Traces, Logs, Metrics in mobile dotnet feat: Support Traces, Logs, Metrics in mobile dotnet 0.5.0 Mar 26, 2026
@abelonogov-ld abelonogov-ld enabled auto-merge (squash) March 26, 2026 22:37
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@abelonogov-ld abelonogov-ld merged commit 8e9483a into main Mar 27, 2026
24 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/dotnet-traces branch March 27, 2026 00:18
abelonogov-ld pushed a commit that referenced this pull request Mar 27, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-observability-android: 0.33.0</summary>

##
[0.33.0](launchdarkly-observability-android-0.32.0...launchdarkly-observability-android-0.33.0)
(2026-03-27)


### Features

* Support Traces, Logs, Metrics in mobile dotnet 0.5.0
([#428](#428))
([8e9483a](8e9483a))
</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 release bookkeeping only: bumps
`sdk/@launchdarkly/observability-android` version and updates the
changelog/manifest with no functional code changes shown in this diff.
> 
> **Overview**
> Updates the release metadata for
`sdk/@launchdarkly/observability-android` to `0.33.0` by bumping the
version in `.release-please-manifest.json` and `gradle.properties`.
> 
> Adds the `0.33.0` entry to
`sdk/@launchdarkly/observability-android/CHANGELOG.md` describing the
new feature included in this release.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1567e02. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

2 participants