From 08791182856fa794a8fe5328f23ffa3fbd5959f7 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 1 Feb 2024 09:52:06 -0800 Subject: [PATCH] [internal/aws/proxy] adopt `component.UseLocalHostAsDefaultHost` feature gate (#30987) Description: internal/aws/proxy adopts `component.UseLocalHostAsDefaultHost` feature gate Link to tracking Issue: https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30702 Fixes https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30986 Documentation: Updated docs. --------- Co-authored-by: Pablo Baeyens Co-authored-by: Pablo Baeyens --- .chloggen/mx-psi_internal-localhostgate.yaml | 1 + internal/aws/proxy/cfg.go | 4 +++- receiver/awsxrayreceiver/README.md | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.chloggen/mx-psi_internal-localhostgate.yaml b/.chloggen/mx-psi_internal-localhostgate.yaml index d3416b82fa79..46c5afc6812d 100755 --- a/.chloggen/mx-psi_internal-localhostgate.yaml +++ b/.chloggen/mx-psi_internal-localhostgate.yaml @@ -20,6 +20,7 @@ subtext: | - extension/awsproxy - extension/health_check - extension/jaegerremotesampling + - internal/aws/proxy - processor/remotetap - receiver/awsfirehose - receiver/awsxray diff --git a/internal/aws/proxy/cfg.go b/internal/aws/proxy/cfg.go index 7697960d1c10..5b45314c13c5 100644 --- a/internal/aws/proxy/cfg.go +++ b/internal/aws/proxy/cfg.go @@ -6,6 +6,8 @@ package proxy // import "github.com/open-telemetry/opentelemetry-collector-contr import ( "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/config/configtls" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate" ) // Config is the configuration for the local TCP proxy server. @@ -43,7 +45,7 @@ type Config struct { func DefaultConfig() *Config { return &Config{ TCPAddr: confignet.TCPAddr{ - Endpoint: "0.0.0.0:2000", + Endpoint: localhostgate.EndpointForPort(2000), }, ProxyAddress: "", TLSSetting: configtls.TLSClientSetting{ diff --git a/receiver/awsxrayreceiver/README.md b/receiver/awsxrayreceiver/README.md index 36bad83c942f..6582d5f28589 100644 --- a/receiver/awsxrayreceiver/README.md +++ b/receiver/awsxrayreceiver/README.md @@ -63,6 +63,8 @@ The TCP address and port on which this receiver listens for calls from the X-Ray Default: `0.0.0.0:2000` +The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:2000. This will become the default in a future release. + ### proxy_address (Optional) Defines the proxy address that the local TCP server forwards HTTP requests to AWS X-Ray backend through. If left unconfigured, requests will be sent directly.