You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
1636bcdd1d
When setting an explicit OTLP traces endpoint URL (via `otlptracehttp.WithEndpointURL` or the `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` environment variable), any given trailing slash is stripped. This makes it impossible to export traces to an endpoint requiring a trailing slash. It also conflicts with [the spec](https://opentelemetry.io/docs/specs/otel/protocol/exporter/#endpoint-urls-for-otlphttp): > For the per-signal variables (OTEL_EXPORTER_OTLP_\<signal\>_ENDPOINT), the URL MUST be used as-is without any modification. The only exception is that if an URL contains no path part, the root path / MUST be used (see [Example 2](https://opentelemetry.io/docs/specs/otel/protocol/exporter/#example-2)). This stripping happens due to [the use of `path.Clean` in `otlpconfig.cleanPath`](https://github.com/open-telemetry/opentelemetry-go/blob/b4b461d050f1d0f5bda89ddac718180162120606/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go#L97). From [the `path.Clean` docs](https://pkg.go.dev/path#Clean): > The returned path ends in a slash only if it is the root "/". Fixes #6709.
Shared
Code under this directory contains reusable internal code which is distributed across packages using //go:generate gotmpl in gen.go files.