You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone 🙂 It looks like the handling of the OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_ENDPOINT environment variables is not in compliance with the spec, there are a few examples of this that we discovered in some internal testing:
endpoint and OTEL_EXPORTER_OTLP_ENDPOINT are both set to the same value, `
expected behavior: the URL from endpoint is used and not modified
actual behavior: v1/traces is appended to the endpoint
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_ENDPOINT are set to the same value
expected behavior: the URL from OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is used and not modified
actual behavior: when v1/tracesis appended to the value fromOTEL_EXPORTER_OTLP_TRACES_ENDPOINT`
if OTEL_EXPORTER_OTLP_ENDPOINT does not have a trailing slash (example: https://localhost:1234/api/v2/otlp)
expected behavior: the URL from OTEL_EXPORTER_OTLP_ENDPOINT is appended with /v1/traces (example: https://localhost:1234/api/v2/otlp becomes https://localhost:1234/api/v2/otlp/v1/traces)
actual behavior: the URL from OTEL_EXPORTER_OTLP_ENDPOINT is stripped of the last part and appended with /v1/traces (example: https://localhost:1234/api/v2/otlp becomes https://localhost:1234/api/v2/v1/otlp)
Tests intended for `exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb', all of them should fail in the current implementation
it'does not join endpoint with v1/traces if endpoint is set and is equal to OTEL_EXPORTER_OTLP_ENDPOINT'doexp=OpenTelemetry::TestHelpers.with_env('OTEL_EXPORTER_OTLP_ENDPOINT'=>'https://localhost:1234/custom/path')doOpenTelemetry::Exporter::OTLP::Exporter.new(endpoint: 'https://localhost:1234/custom/path')end_(exp.instance_variable_get(:@path)).must_equal'/custom/path'endit'appends the correct path if OTEL_EXPORTER_OTLP_ENDPOINT does have a path without a trailing slash'doexp=OpenTelemetry::TestHelpers.with_env(# simulate OTLP endpoints built on top of an exiting API'OTEL_EXPORTER_OTLP_ENDPOINT'=>'https://localhost:1234/api/v2/otlp')doOpenTelemetry::Exporter::OTLP::Exporter.newend_(exp.instance_variable_get(:@path)).must_equal'/api/v2/otlp/v1/traces'endit'appends the correct path if OTEL_EXPORTER_OTLP_ENDPOINT does have a path without a trailing slash'doexp=OpenTelemetry::TestHelpers.with_env(# simulate OTLP endpoints built on top of an exiting API'OTEL_EXPORTER_OTLP_ENDPOINT'=>'https://localhost:1234/api/v2/otlp')doOpenTelemetry::Exporter::OTLP::Exporter.newend_(exp.instance_variable_get(:@path)).must_equal'/api/v2/otlp/v1/traces'end
The text was updated successfully, but these errors were encountered:
Description of the bug
Hi everyone 🙂 It looks like the handling of the
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
andOTEL_EXPORTER_OTLP_ENDPOINT
environment variables is not in compliance with the spec, there are a few examples of this that we discovered in some internal testing:endpoint
andOTEL_EXPORTER_OTLP_ENDPOINT
are both set to the same value, `endpoint
is used and not modifiedv1/traces
is appended to theendpoint
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
andOTEL_EXPORTER_OTLP_ENDPOINT
are set to the same valueOTEL_EXPORTER_OTLP_TRACES_ENDPOINT
is used and not modifiedis appended to the value from
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`OTEL_EXPORTER_OTLP_ENDPOINT
does not have a trailing slash (example:https://localhost:1234/api/v2/otlp
)OTEL_EXPORTER_OTLP_ENDPOINT
is appended with/v1/traces
(example:https://localhost:1234/api/v2/otlp
becomeshttps://localhost:1234/api/v2/otlp/v1/traces
)OTEL_EXPORTER_OTLP_ENDPOINT
is stripped of the last part and appended with/v1/traces
(example:https://localhost:1234/api/v2/otlp
becomeshttps://localhost:1234/api/v2/v1/otlp
)Share details about your runtime
Operating system details: Linux, Ubuntu 22.04 LTS
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.2.0"
RUBY_DESCRIPTION: "ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]"
Share a simplified reproduction if possible
Tests intended for `exporter/otlp/test/opentelemetry/exporter/otlp/exporter_test.rb', all of them should fail in the current implementation
The text was updated successfully, but these errors were encountered: