OTLP/HTTP does not use OTEL_EXPORTER_OTLP_ENDPOINT as a base URL correctly. #2968
Labels
bug
Something isn't working
pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol
Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Stale
Issues and pull requests which have been flagged for closing due to inactivity
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, ifOTEL_EXPORTER_OTLP_ENDPOINT
ishttp://localhost:4318/v1/traces/
, then the resulting url should behttp://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
ishttp://localhost:4318/v1/traces/
the signal endpoint is not appended.Reproduce
Set
OTEL_EXPORTER_OTLP_ENDPOINT
to behttp://localhost:4318/v1/traces/
.Observer that traces are send to
http://localhost:4318/v1/traces
instead ofhttp://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.
The text was updated successfully, but these errors were encountered: