Fix MAUI OTLP dev tunnel resolution - #19386
Open
Gerald Versluis (jfversluis) wants to merge 2 commits into
Open
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19386Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19386" |
This was referenced Aug 14, 2026
Copilot started reviewing on behalf of
Gerald Versluis (jfversluis)
August 14, 2026 12:40
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Improves MAUI telemetry connectivity through Dev Tunnels and refreshes mobile launch environments after restarts.
Changes:
- Prefers OTLP/HTTP and resolves concrete dashboard listener ports.
- Regenerates stable Android/iOS environment targets.
- Adds regression tests and documentation.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs |
Adds endpoint and protocol resolution. |
src/Aspire.Hosting.Maui/Annotations/OtlpDevTunnelConfigurationAnnotation.cs |
Tracks one-shot endpoint resolution. |
src/Aspire.Hosting.Maui/Otlp/OtlpLoopbackResource.cs |
Clarifies loopback targeting. |
src/Aspire.Hosting.Maui/Utilities/MauiAndroidEnvironmentAnnotation.cs |
Regenerates Android targets. |
src/Aspire.Hosting.Maui/Utilities/MauiiOSEnvironmentAnnotation.cs |
Regenerates iOS targets. |
src/Aspire.Hosting.Maui/Utilities/MauiEnvironmentHelper.cs |
Uses stable target paths. |
src/Aspire.Hosting.Maui/README.md |
Documents protocol selection and restart behavior. |
tests/Aspire.Hosting.Maui.Tests/MauiPlatformExtensionsTests.cs |
Adds endpoint, failure, and restart coverage. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Gerald Versluis (jfversluis)
August 14, 2026 13:49
View session
Contributor
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
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.
Description
This extracts the MAUI OTLP dev-tunnel and mobile environment refresh work from #18591 into a focused follow-up to #19383. The launch-queue handoff remains isolated in #19383; this PR only addresses how MAUI resources reach the Aspire Dashboard OTLP listener and refresh mobile launch environments.
MAUI apps running on Android and iOS cannot reliably reach the AppHost's local OTLP listener directly.
WithOtlpDevTunnel()now prefers the Dashboard OTLP/HTTP endpoint and configuresOTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf, falling back to OTLP/gRPC only when HTTP is unavailable. It forwards to the concrete allocated listener port rather than an unrelated DCP proxy port.The resolver handles configured endpoint URLs, executable target ports, DCP target-port expressions, container/proxy endpoints, localhost TLDs, and wildcard local bindings. Resolution is one-shot for this focused slice and bounded when waiting for DCP snapshots. Dashboard-disabled, terminated, timeout, unresolved, synthetic-stub, and invalid-configuration cases fail with actionable errors instead of hanging.
Android and iOS now rewrite stable per-resource MSBuild environment targets whenever launch arguments are reevaluated, so restarted MAUI resources receive current OTLP URL, protocol, and environment values.
User-facing usage
The existing C# API is unchanged:
WithOtlpDevTunnel()remains run-only and does not add tunnel environment values to published manifests.Scope
Included:
Deferred to a separate DevTunnels change:
No Aspire.Hosting core/DCP lifecycle, Dashboard, Foundry, playground, dependency, generated API, or snapshot files are changed.
Validation
./restore.shdotnet build src/Aspire.Hosting.Maui/Aspire.Hosting.Maui.csproj --no-restore— succeeded with 0 warnings and 0 errorsAspire.Hosting.Maui.Testsproject with quarantined and outerloop exclusions — 189 passedgit diff --check origin/main..HEADand the eight-file MAUI-only allowlist check passedRelated PRs:
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?