Skip to content

Verify OTel linker preserve configs for Android/iOS Release #170

@davidortinau

Description

@davidortinau

Tracking issue surfaced during PR #166.

Risk

OpenTelemetry and Azure Monitor Exporter rely heavily on reflection for:

  • Resource attribute discovery
  • Exporter type resolution
  • Instrumentation library activation (e.g., HttpClient, EF Core)

In Release builds with the IL linker set aggressive (default for iOS; opt-in for Android), reflection-only types can be trimmed away. Telemetry silently stops working in production builds while Debug/Catalyst works fine.

Work required

  • Produce a Release build for iOS (net10.0-ios) and Android, install on physical devices
  • Exercise the app and verify mobile telemetry (cloud_RoleName containing Mobile/iOS/Maui) appears in App Insights sstudio-mobile-ai
  • If telemetry is missing: audit linker warnings, add <TrimmerRootDescriptor> or [DynamicallyAccessedMembers] attributes to preserve required OTel types
  • Document the preserve patterns in the runbook under "Deploying mobile Release builds"
  • Add a post-publish smoke check to the iOS-to-DX24 workflow in docs/deploy-runbook.md (KQL for mobile-tagged telemetry within 15m of install)

Why it matters

Without this verification, mobile ↔ API correlation could silently degrade in Release even though the wiring is correct — the PR #166 correlation join query would return zero rows even with fresh builds on-device.

Context: PR #166

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions