{"record":{"id":"035c7a7062755e44","repo":"microsoft/aspire","slug":"the-maui-otlp-protocol-could-not-be-determined-because-the","errorCode":null,"errorMessage":"The MAUI OTLP protocol could not be determined because the dashboard did not publish a concrete OTLP listener within {resolutionTimeout:c}.","messagePattern":"The MAUI OTLP protocol could not be determined because the dashboard did not publish a concrete OTLP listener within (.+?)\\.","errorType":"exception","errorClass":"DistributedApplicationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs","lineNumber":615,"sourceCode":"\n    private sealed class OtlpProtocolValueProvider(\n        EndpointAnnotation endpoint,\n        TimeSpan resolutionTimeout) : IValueProvider\n    {\n        public async ValueTask<string?> GetValueAsync(CancellationToken cancellationToken = default)\n        {\n            try\n            {\n#pragma warning disable CS0618 // Type or member is obsolete\n                await endpoint.AllocatedEndpointSnapshot\n                    .GetValueAsync(cancellationToken)\n                    .WaitAsync(resolutionTimeout, cancellationToken)\n                    .ConfigureAwait(false);\n#pragma warning restore CS0618 // Type or member is obsolete\n            }\n            catch (TimeoutException ex)\n            {\n                throw new DistributedApplicationException(\n                    $\"The MAUI OTLP protocol could not be determined because the dashboard did not publish a concrete OTLP listener within {resolutionTimeout:c}.\",\n                    ex);\n            }\n\n            return GetOtlpProtocol(endpoint);\n        }\n    }\n}\n","sourceCodeStart":597,"sourceCodeEnd":624,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs#L597-L624","documentation":"The OTLP transport protocol (grpc vs protobuf/http) for MAUI telemetry could not be determined because the dashboard resource never published a concrete OTLP listener within the timeout. The code waits for the dashboard endpoint snapshot with WaitAsync(resolutionTimeout); on TimeoutException it throws this DistributedApplicationException.","triggerScenarios":"Requesting the MAUI OTLP protocol while the dashboard resource fails to publish a concrete endpoint snapshot before resolutionTimeout expires — dashboard slow, failed, or absent.","commonSituations":"Dashboard container still pulling its image, dashboard crashed on startup, endpoint metadata not yet materialized during rapid app startup, or the timeout is too aggressive on constrained CI machines.","solutions":["Increase resolutionTimeout to allow the dashboard to publish its endpoint.","Confirm the dashboard resource starts and listens (check its logs and published endpoints).","Rule out dashboard disablement via environment/configuration in the current run.","Retry after the dashboard is healthy; the protocol is derived from the published endpoint."],"exampleFix":"// before\nvar protocol = await otlpProtocol.GetValueAsync(ct); // times out on cold start\n// after\n// wait for dashboard health first, then resolve, or raise the timeout\ndashboardOptions.ResolutionTimeout = TimeSpan.FromMinutes(2);","handlingStrategy":"try-catch","validationCode":"// Wait for a healthy dashboard snapshot before asking for the protocol\nvar dashboardHealthy = await dashboardRef.WaitUntilHealthyAsync(TimeSpan.FromMinutes(2), ct);","typeGuard":"static bool HasConcreteEndpoint(ResourceEvent e) =>\n    !string.IsNullOrEmpty(e.Snapshot?.Properties?.FirstOrDefault(p => p.Name is \"otlpendpoint\" or \"endpoint\")?.Value?.ToString());","tryCatchPattern":"try\n{\n    var protocol = await otlpProtocolValue.GetValueAsync(ct);\n}\ncatch (DistributedApplicationException ex) when (ex.Message.Contains(\"OTLP protocol could not be determined\"))\n{\n    protocol = OtlpProtocol.Grpc; // known dashboard default, or rethrow with context\n}","preventionTips":["Confirm the dashboard resource starts before MAUI resources that need OTLP","Raise resolutionTimeout on image-pull-heavy or CI environments","Do not set environment variables that disable or relocate the dashboard endpoint unexpectedly","Retry resolution after the dashboard becomes healthy instead of failing the whole AppHost"],"tags":["otlp","protocol","timeout","dashboard"],"backgroundTag":"request-timeout","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}