opentelemetry-dotnet icon indicating copy to clipboard operation
opentelemetry-dotnet copied to clipboard

OTLP/HTTP does not use OTEL_EXPORTER_OTLP_ENDPOINT as a base URL correctly.

Open TylerHelmuth opened this issue 2 years ago • 3 comments

Bug Report

Symptom

OTEL_EXPORTER_OTLP_ENDPOINT is not being treated as a base url in the OTLP HTTP exporter as per the OTLP/HTTP spec. Instead, the signal endpoint is being appended only if it is not already present. Method in question is AppendPathIfNotPresent.

What is the expected behavior?

No matter what OTEL_EXPORTER_OTLP_ENDPOINT is, the signal endpoint should be appended using slashes appropriately. For example, if OTEL_EXPORTER_OTLP_ENDPOINT is http://localhost:4318/v1/traces/, then the resulting url should be http://localhost:4318/v1/traces/v1/traces for traces.

What is the actual behavior?

The signal endpoint is only appended if it is not already present. For example, if OTEL_EXPORTER_OTLP_ENDPOINT is http://localhost:4318/v1/traces/ the signal endpoint is not appended.

Reproduce

Set OTEL_EXPORTER_OTLP_ENDPOINT to be http://localhost:4318/v1/traces/. Observer that traces are send to http://localhost:4318/v1/traces instead of http://localhost:4318/v1/traces/v1/traces.

Additional Context

I realize this is a pretty silly issue. Maybe the spec needs updated? Definitely open that discussion.

TylerHelmuth avatar Mar 03 '22 15:03 TylerHelmuth

+1 on this, this is quite critical, it's the only implementation I found that doesn't respect this specification.

kedare avatar May 26 '23 13:05 kedare

Is there any update on this? It seems like quite a big issue that the OTLP exporter is simply not respecting the spec when using OTLP/HTTP.

MeijerM1 avatar Nov 07 '23 09:11 MeijerM1

https://github.com/open-telemetry/opentelemetry-dotnet/issues/5054 maybe same/duplicate!

cijothomas avatar Feb 22 '24 13:02 cijothomas