Skip to content

OTEL_EXPORTER_OTLP_ENDPOINT treatment not following spec #200

@mechie

Description

@mechie

See the Protocol Exporter doc:

If signals are sent that have no per-signal configuration from the previous point, OTEL_EXPORTER_OTLP_ENDPOINT is used as a base URL and the signals are sent to these paths relative to that:

  • Traces: v1/traces

Fairly sure the issue is here:

if endpointURL.Path == "" {
	// Per spec, /v1/traces is the default:
	// (https://github.com/open-telemetry/opentelemetry-specification/blob/c14f5416605cb1bfce6e6e1984cbbeceb1bf35a2/specification/protocol/exporter.md#endpoint-urls-for-otlphttp)
	endpointURL.Path = "/v1/traces"
}

This contradicts Example 3 in the spec:

export OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4318/mycollector/

Traces are sent to http://collector:4318/mycollector/v1/traces

otel-cli will instead try sending the traces to http://collector:4318/mycollector, as the path is not empty. The collector I was sending traces to has a non-empty path in its URL, so this led to a bit of confusion.

Easy enough for us to work around it by giving the trace URL to otel-cli, but this is probably going to surprise other folk.

Unsure how this can be fixed without a breaking change (even if it's arguably a bug), hence bringing it up for discussion instead of trying to PR directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions