OpenTelemetryCollector: WithAppForwarding breaks manifest publish ("The endpoint `grpc` is not allocated for the resource")
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 62/100
Línea de trabajo
El callback que falla está en src/CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector/OpenTelemetryCollectorRoutingExtensions.cs, dentro de WithOpenTelemetryCollectorRouting; la línea problemática es endpoint.Url en una llamada a LogDebug. Para reproducirlo, ejecuta dotnet run sobre el AppHost con --publisher manifest y confirma la excepción. Está terminado cuando el manifiesto se escribe completo y el valor de OTEL_EXPORTER_OTLP_ENDPOINT sigue resolviéndose en el modo de ejecución.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Publishing an AppHost that uses AddOpenTelemetryCollector(...).WithAppForwarding() as a manifest fails with
Step 'publish-manifest' failed: The endpoint `grpc` is not allocated for the resource `otel-collector`.
The manifest file that is written is cut off in the middle (not valid JSON), and the process still exits with code 0.
Running the AppHost works; only publishing fails.
Cause
The environment callback registered by WithOpenTelemetryCollectorRouting reads endpoint.Url as an argument of a debug log call:
src/CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector/OpenTelemetryCollectorRoutingExtensions.cs
var endpoint = collectorBuilder.Resource.GetEndpoint(endpointName);
callback.Logger.LogDebug("Forwarding Telemetry for {name} to the collector on {endpoint}", builder.Resource.Name, endpoint.Url);
The argument is evaluated whatever the log level is. In publish mode no endpoint is allocated, so EndpointReference.Url throws. The line after it, which sets OTEL_EXPORTER_OTLP_ENDPOINT to the endpoint reference itself, is fine in both modes.
Stack trace (top):
System.InvalidOperationException: The endpoint `grpc` is not allocated for the resource `otel-collector`.
at Aspire.Hosting.ApplicationModel.EndpointReference.get_AllocatedEndpoint()
at Aspire.Hosting.ApplicationModel.EndpointReference.get_Url()
at Aspire.Hosting.OpenTelemetryCollectorRoutingExtensions.<>c__DisplayClass0_0`1.<WithOpenTelemetryCollectorRouting>b__0(EnvironmentCallbackContext callback)
at Aspire.Hosting.ApplicationModel.EnvironmentCallbackAnnotation.ExecuteCallbackAsync(EnvironmentCallbackContext context)
...
at Aspire.Hosting.Publishing.ManifestPublishingContext.WriteEnvironmentVariablesAsync(IResource resource)
at Aspire.Hosting.Publishing.ManifestPublishingContext.WriteContainerAsync(ContainerResource container)
Steps to reproduce
-
An AppHost with at least one container or project resource and
builder.AddOpenTelemetryCollector("otel-collector") .WithConfig("./otel/config.yaml") .WithAppForwarding(); -
dotnet run --project <AppHost> -- --publisher manifest --output-path ./manifest.json
I have not reduced this to a minimal project; the stack trace and the source line above are from a larger AppHost.
Expected behavior
The manifest is written completely; OTEL_EXPORTER_OTLP_ENDPOINT of the routed resources is an expression that refers to the collector's endpoint.
Suggested fix
Do not read Url in the callback, for example log the endpoint's name instead of its address, or log only in run mode (callback.ExecutionContext.IsRunMode). I can send a pull request for that if it helps.
Versions
- CommunityToolkit.Aspire.Hosting.OpenTelemetryCollector 13.6.1 (the line is also on
mainas of 2026-11-23) - Aspire.Hosting / Aspire.AppHost.Sdk 13.6.5
- .NET 10
- Lenguaje dominante
- C#
- Estrellas
- 637
- Forks
- 209
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 131
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CommunityToolkit/Aspire
-
Dificultad 4/5 1-2 días Aptitud para principiantes 22/100
CommunityToolkit/Aspire#2596 ·
Los mantenedores suelen responder en 1 día
-
feature request :mailbox_with_mail:
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
CommunityToolkit/Aspire#2591 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
CommunityToolkit/Aspire#2533 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
CommunityToolkit/Aspire#2436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[SqlProjects] Improve checksum cheksPosiblemente ocupada @ErikEJ la tomó hace 15 días. Abierto
CommunityToolkit/Aspire#2435 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de CommunityToolkit/Aspire
Issues similares
-
Scaffold marks an association as required when its composite foreign key has a nullable columnAbiertoarea: scaffold status: needs-tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
provider:flagd type:fix
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
open-feature/dotnet-sdk-contrib#789 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
NimblePros/Metronome#23 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
jsboige/CoursIA#28504 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
要トリアージ
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día