Skip to content

If users specify OTEL_EXPORTER_OTLP_ENDPOINT, don't overwrite it with Aspire's default OTLP endpoint #11298

@Aaronontheweb

Description

@Aaronontheweb

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.

Related: practical-otel/opentelemetry-aspire-collector#1

I just went through a lot of trouble debugging this in one of our own applications and made a YouTube video about it, but TL;DR; .NET Aspire 9.4 will front-run the OTEL_EXPORTER_OTLP_ENDPOINT and overwrite it with its own dashboard OTLP ingestion endpoint at the last minute, even though it looks like it's set correctly inside the .NET Aspire resources view in the first place.

Image

Short video I made demo-ing this and a suggested work-around (using custom environment variables and then explicitly using them in the OTEL pipeline): https://www.youtube.com/watch?v=dCKyNCdtaVc

Describe the solution you'd like

if a user is going through the trouble of explicitly specifying OTEL_EXPORTER_OTLP_ENDPOINT inside the Aspire AppHost, Aspire shouldn't front-run that and substitute its own values. I've seen the solutions used in projects like https://github.com/dotnet/aspire-samples/tree/main/samples/Metrics and that seems... Like a tremendous amount of work on the part of the user for what amounts to setting an environment variable.

It'd be better if Aspire just didn't try to overwrite the OTEL_EXPORTER_OTLP_ENDPOINT value if it was already specified here, rather than requiring a Manhattan Project's worth of Aspire internals knowledge or a third party plugin implementing the same.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions