Skip to content

Allow users to configure preferred protocol (gRPC or HTTP/Protobuf) for OpenTelemetry endpoints #6789

@wterpstra

Description

@wterpstra

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

See this code:

https://github.com/dotnet/aspire/blob/c9326c75b42b28e3f3a4174f9b24bad9f22305e9/src/Aspire.Hosting/OtlpConfigurationExtensions.cs#L48C1-L63C14

Currently the gRPC endpoint is preferred over the HTTP/Protobuf endpoint. When running a frontend application with for example the Aspire.Hosting.NodeAppResource it will always default to the gRPC endpoint, even though only the HTTP/Protobuf endpoint is feasible for frontends. While it is possible to disable the gRPC endpoint, this is not ideal. I would still like to run my APIs with the gRPC endpoint since that matches the eventual production configuration

Describe the solution you'd like

I propose adding an extra overload to the OtlpConfigurationExtensions.WithOtlpExporter(...). This overload would allow users to explicitly configure which endpoint (and protocol) should be used. If an endpoint is selected that is not running on the dashboard, an exception should be thrown.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions