From 11b32aeab1cfac122b3e17502e271fad0d61c6be Mon Sep 17 00:00:00 2001 From: Sam Xie Date: Fri, 26 Jul 2024 11:23:21 -0700 Subject: [PATCH 1/3] Correct the comment for the priority of options and environments on otlploghttp --- exporters/otlp/otlplog/otlploghttp/config.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/exporters/otlp/otlplog/otlploghttp/config.go b/exporters/otlp/otlplog/otlploghttp/config.go index 383890d91d5..88a8d5e1f10 100644 --- a/exporters/otlp/otlplog/otlploghttp/config.go +++ b/exporters/otlp/otlplog/otlploghttp/config.go @@ -143,8 +143,12 @@ func newConfig(options []Option) config { // // If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT // environment variable is set, and this option is not passed, that variable -// value will be used. If both are set, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT -// will take precedence. +// value will be used. If both environment variables are set, +// OTEL_EXPORTER_OTLP_LOGS_ENDPOINT will take precedence. If an environment +// variable is set, and this option is passed, this option will take precedence. +// +// If both this option and WithEndpointURL are used, the last used option will +// take precedence. // // By default, if an environment variable is not set, and this option is not // passed, "localhost:4318" will be used. @@ -159,8 +163,9 @@ func WithEndpoint(endpoint string) Option { // // If the OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT // environment variable is set, and this option is not passed, that variable -// value will be used. If both are set, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT -// will take precedence. +// value will be used. If both environment variables are set, +// OTEL_EXPORTER_OTLP_LOGS_ENDPOINT will take precedence. If an environment +// variable is set, and this option is passed, this option will take precedence. // // If both this option and WithEndpoint are used, the last used option will // take precedence. From 990ac2730fb57b05a25466ca57071d105f71154a Mon Sep 17 00:00:00 2001 From: Sam Xie Date: Fri, 26 Jul 2024 11:43:54 -0700 Subject: [PATCH 2/3] Update tests --- exporters/otlp/otlplog/otlploghttp/config_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exporters/otlp/otlplog/otlploghttp/config_test.go b/exporters/otlp/otlplog/otlploghttp/config_test.go index d07b89d93e4..d3ef1cc1977 100644 --- a/exporters/otlp/otlplog/otlploghttp/config_test.go +++ b/exporters/otlp/otlplog/otlploghttp/config_test.go @@ -288,6 +288,7 @@ func TestNewConfig(t *testing.T) { }, options: []Option{ WithEndpoint("test"), + WithEndpointURL("https://test2/path2"), WithURLPath("/path"), WithInsecure(), WithTLSClientConfig(tlsCfg), @@ -297,7 +298,7 @@ func TestNewConfig(t *testing.T) { WithRetry(RetryConfig(rc)), }, want: config{ - endpoint: newSetting("test"), + endpoint: newSetting("test2"), path: newSetting("/path"), insecure: newSetting(true), tlsCfg: newSetting(tlsCfg), From aaa30c30eb31b07b9a7d584e8ff2615f23e22c8f Mon Sep 17 00:00:00 2001 From: Sam Xie Date: Fri, 26 Jul 2024 11:46:34 -0700 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7791db7575..0a808bee099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Correct the `Tracer` names used in `go.opentelemetry.io/otel/example/zipkin`. (#5612) - Pass the underlying error rather than a generic retry-able failure in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`, `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` and `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`. (#5541) - Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#5641) +- Correct comments for the priority of the `WithEndpoint` and `WithEndpointURL` options and their corresponding environment variables in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#5650)