From e18a523fcc5fc19cd02817decfb79d7f5806d36a Mon Sep 17 00:00:00 2001 From: Elena Nuretdinova Date: Fri, 12 Jan 2024 16:41:38 +0100 Subject: [PATCH] Add comment & fix lint --- exporters/otlp/otlpmetric/otlpmetrichttp/config.go | 9 +++++++++ .../otlpmetrichttp/internal/otest/collector.go | 2 +- .../otlptracehttp/internal/otlpconfig/options.go | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/config.go b/exporters/otlp/otlpmetric/otlpmetrichttp/config.go index 7a3b2ddde3c..e735dacd8ef 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/config.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/config.go @@ -150,6 +150,15 @@ func WithHeaders(headers map[string]string) Option { } // WithHostHeader overrides Host header in HTTP requests. +// +// The example of the use case is using load balancer like envoy between +// the otel instrumentation library and collector. Typically +// the call via envoy's route is based on the host header. Example of the usage +// +// config.WithEndpoint("myenvoyhost") +// +// .WithHostHeader("mytargetotelcollectorhost") +// // If unset, the target Endpoint's host will be used as Host header. func WithHostHeader(host string) Option { return wrappedOption{oconf.WithHostHeader(host)} diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/otest/collector.go b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/otest/collector.go index 870f2f76b56..f143b2f2a8e 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/internal/otest/collector.go +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/internal/otest/collector.go @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otest +package otest // import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp/internal/otest" import ( "bytes" diff --git a/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go b/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go index 41b175e7230..460c71dadb9 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go +++ b/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig/options.go @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package otlpconfig +package otlpconfig // import "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig" import ( "crypto/tls"