opentelemetry-dotnet
opentelemetry-dotnet copied to clipboard
OTLP/HTTP does not use OTEL_EXPORTER_OTLP_ENDPOINT as a base URL correctly.
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.
+1 on this, this is quite critical, it's the only implementation I found that doesn't respect this specification.
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.
https://github.com/open-telemetry/opentelemetry-dotnet/issues/5054 maybe same/duplicate!