From fe104466a641eae7351695e23b7e7ae5b1760691 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 23 Sep 2024 10:25:46 -0700 Subject: [PATCH] Mark UseLocalHostAsDefaultHostfeatureGate as stable (#11235) Signed-off-by: Bogdan Drutu --- .chloggen/stable-localhost.yaml | 20 +++++++++++++++ config/configgrpc/configgrpc_test.go | 9 ------- config/configgrpc/go.mod | 7 ------ config/configgrpc/go.sum | 2 -- config/confighttp/confighttp_test.go | 9 ------- config/confighttp/go.mod | 7 ------ config/confighttp/go.sum | 2 -- config/internal/go.mod | 9 ++----- config/internal/go.sum | 8 ++++-- config/internal/warning.go | 7 ++---- exporter/otlpexporter/go.mod | 25 +++++++------------ exporter/otlpexporter/go.sum | 2 -- exporter/otlphttpexporter/go.mod | 17 ++++--------- exporter/otlphttpexporter/go.sum | 2 -- extension/zpagesextension/go.mod | 17 ++++--------- extension/zpagesextension/go.sum | 2 -- internal/globalgates/globalgates.go | 5 ++-- receiver/otlpreceiver/factory.go | 18 ++------------ receiver/otlpreceiver/factory_test.go | 35 --------------------------- receiver/otlpreceiver/go.mod | 17 ++++--------- receiver/otlpreceiver/go.sum | 2 -- service/service.go | 12 --------- 22 files changed, 59 insertions(+), 175 deletions(-) create mode 100644 .chloggen/stable-localhost.yaml diff --git a/.chloggen/stable-localhost.yaml b/.chloggen/stable-localhost.yaml new file mode 100644 index 00000000000..6c1cd1fd2af --- /dev/null +++ b/.chloggen/stable-localhost.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'breaking' + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: config + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Mark UseLocalHostAsDefaultHostfeatureGate as stable + +# One or more tracking issues or pull requests related to the change +issues: [11235] + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index 585b0c6d7c1..e46c8a546d3 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -34,8 +34,6 @@ import ( "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/extension/auth" "go.opentelemetry.io/collector/extension/auth/authtest" - "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp" ) @@ -533,13 +531,6 @@ func TestUseSecure(t *testing.T) { } func TestGRPCServerWarning(t *testing.T) { - prev := globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() - require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, false)) - defer func() { - // Restore previous value. - require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, prev)) - }() - tests := []struct { name string settings ServerConfig diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod index 671db7dba4d..f3776d78bab 100644 --- a/config/configgrpc/go.mod +++ b/config/configgrpc/go.mod @@ -15,8 +15,6 @@ require ( go.opentelemetry.io/collector/config/configtls v1.15.0 go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b go.opentelemetry.io/collector/extension/auth v0.109.0 - go.opentelemetry.io/collector/featuregate v1.15.0 - go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.opentelemetry.io/collector/pdata v1.15.0 go.opentelemetry.io/collector/pdata/testdata v0.109.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 @@ -34,7 +32,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -77,8 +74,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -89,8 +84,6 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/consumer => ../../consumer -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/configgrpc/go.sum b/config/configgrpc/go.sum index b5f8e6cb3b3..8f3f30fa9e1 100644 --- a/config/configgrpc/go.sum +++ b/config/configgrpc/go.sum @@ -17,8 +17,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go index aaaef2bb501..7d16eb12ef3 100644 --- a/config/confighttp/confighttp_test.go +++ b/config/confighttp/confighttp_test.go @@ -34,8 +34,6 @@ import ( "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/extension/auth" "go.opentelemetry.io/collector/extension/auth/authtest" - "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/globalgates" ) type customRoundTripper struct { @@ -520,13 +518,6 @@ func TestHTTPServerSettingsError(t *testing.T) { } func TestHTTPServerWarning(t *testing.T) { - prev := globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() - require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, false)) - defer func() { - // Restore previous value. - require.NoError(t, featuregate.GlobalRegistry().Set(globalgates.UseLocalHostAsDefaultHostID, prev)) - }() - tests := []struct { name string settings ServerConfig diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod index ef5cd086c7a..48e3a0c1054 100644 --- a/config/confighttp/go.mod +++ b/config/confighttp/go.mod @@ -16,8 +16,6 @@ require ( go.opentelemetry.io/collector/config/configtls v1.15.0 go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b go.opentelemetry.io/collector/extension/auth v0.109.0 - go.opentelemetry.io/collector/featuregate v1.15.0 - go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 go.opentelemetry.io/otel v1.30.0 go.opentelemetry.io/otel/metric v1.30.0 @@ -34,7 +32,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.0.0-20240923154032-388e56cdb156 // indirect @@ -68,8 +65,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/component => ../../component @@ -82,8 +77,6 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal replace go.opentelemetry.io/collector/pipeline => ../../pipeline diff --git a/config/confighttp/go.sum b/config/confighttp/go.sum index 3a725581531..4b711f32c32 100644 --- a/config/confighttp/go.sum +++ b/config/confighttp/go.sum @@ -17,8 +17,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/config/internal/go.mod b/config/internal/go.mod index 8fad43d6125..789a39e4a7f 100644 --- a/config/internal/go.mod +++ b/config/internal/go.mod @@ -4,21 +4,16 @@ go 1.22.0 require ( github.com/stretchr/testify v1.9.0 - go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - go.opentelemetry.io/collector/featuregate v1.15.0 // indirect go.uber.org/multierr v1.11.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - -replace go.opentelemetry.io/collector/featuregate => ../../featuregate diff --git a/config/internal/go.sum b/config/internal/go.sum index 9e6446c034d..fa6db793021 100644 --- a/config/internal/go.sum +++ b/config/internal/go.sum @@ -1,13 +1,17 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= diff --git a/config/internal/warning.go b/config/internal/warning.go index 26eca49a7bb..0f5f6363431 100644 --- a/config/internal/warning.go +++ b/config/internal/warning.go @@ -9,8 +9,6 @@ import ( "strings" "go.uber.org/zap" - - "go.opentelemetry.io/collector/internal/globalgates" ) func shouldWarn(endpoint string) bool { @@ -38,14 +36,13 @@ func shouldWarn(endpoint string) bool { // WarnOnUnspecifiedHost emits a warning if an endpoint has an unspecified host. func WarnOnUnspecifiedHost(logger *zap.Logger, endpoint string) { - if !globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() && shouldWarn(endpoint) { + if shouldWarn(endpoint) { logger.Warn( - "Using the 0.0.0.0 address exposes this server to every network interface, which may facilitate Denial of Service attacks. Enable the feature gate to change the default and remove this warning.", + "Using the 0.0.0.0 address exposes this server to every network interface, which may facilitate Denial of Service attacks.", zap.String( "documentation", "https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md#safeguards-against-denial-of-service-attacks", ), - zap.String("feature gate ID", globalgates.UseLocalHostAsDefaultHostID), ) } } diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index f6e155db78a..4202bf6f8c1 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -34,7 +34,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -57,8 +56,6 @@ require ( go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect - go.opentelemetry.io/collector/featuregate v1.15.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.0.0-20240923154032-388e56cdb156 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.opentelemetry.io/collector/pipeline v0.0.0-20240923154032-388e56cdb156 // indirect @@ -77,8 +74,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector => ../../ - replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/config/configcompression => ../../config/configcompression @@ -105,8 +100,6 @@ replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -119,11 +112,6 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/client => ../../client -retract ( - v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 - v0.69.0 // Release failed, use v0.69.1 -) - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry @@ -132,16 +120,21 @@ replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consume replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus - replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receiver/receiverprofiles replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles + +replace go.opentelemetry.io/collector => ../.. + +replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus + +retract ( + v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 + v0.69.0 // Release failed, use v0.69.1 +) diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum index 54f9125b5cb..b14b38d289a 100644 --- a/exporter/otlpexporter/go.sum +++ b/exporter/otlpexporter/go.sum @@ -21,8 +21,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 3dd1b9fd665..915299fc3c2 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -33,7 +33,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -56,8 +55,6 @@ require ( go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.109.0 // indirect - go.opentelemetry.io/collector/featuregate v1.15.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.0.0-20240923154032-388e56cdb156 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.109.0 // indirect go.opentelemetry.io/collector/pipeline v0.0.0-20240923154032-388e56cdb156 // indirect @@ -104,8 +101,6 @@ replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -116,11 +111,6 @@ replace go.opentelemetry.io/collector/receiver => ../../receiver replace go.opentelemetry.io/collector/consumer => ../../consumer -retract ( - v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 - v0.69.0 // Release failed, use v0.69.1 -) - replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles @@ -135,10 +125,13 @@ replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../../receive replace go.opentelemetry.io/collector/exporter/exporterprofiles => ../exporterprofiles -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles + +retract ( + v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 + v0.69.0 // Release failed, use v0.69.1 +) diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum index ccdfca7a8ba..2043c09ab5d 100644 --- a/exporter/otlphttpexporter/go.sum +++ b/exporter/otlphttpexporter/go.sum @@ -23,8 +23,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/extension/zpagesextension/go.mod b/extension/zpagesextension/go.mod index 0d39331c4a3..94f9bb61947 100644 --- a/extension/zpagesextension/go.mod +++ b/extension/zpagesextension/go.mod @@ -28,7 +28,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -44,8 +43,6 @@ require ( go.opentelemetry.io/collector/config/configtls v1.15.0 // indirect go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect - go.opentelemetry.io/collector/featuregate v1.15.0 // indirect - go.opentelemetry.io/collector/internal/globalgates v0.109.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.0.0-20240923154032-388e56cdb156 // indirect go.opentelemetry.io/collector/pdata v1.15.0 // indirect go.opentelemetry.io/collector/pipeline v0.0.0-20240923154032-388e56cdb156 // indirect @@ -71,17 +68,10 @@ replace go.opentelemetry.io/collector/confmap => ../../confmap replace go.opentelemetry.io/collector/extension => ../ -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/consumer => ../../consumer -retract ( - v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 - v0.69.0 // Release failed, use v0.69.1 -) - replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -110,8 +100,11 @@ replace go.opentelemetry.io/collector/client => ../../client replace go.opentelemetry.io/collector/component/componentstatus => ../../component/componentstatus -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal + +retract ( + v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 + v0.69.0 // Release failed, use v0.69.1 +) diff --git a/extension/zpagesextension/go.sum b/extension/zpagesextension/go.sum index 9e98e8064a1..c10ef762d05 100644 --- a/extension/zpagesextension/go.sum +++ b/extension/zpagesextension/go.sum @@ -19,8 +19,6 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/internal/globalgates/globalgates.go b/internal/globalgates/globalgates.go index 3a44f1fdb61..d018e9dd842 100644 --- a/internal/globalgates/globalgates.go +++ b/internal/globalgates/globalgates.go @@ -19,10 +19,11 @@ const UseLocalHostAsDefaultHostID = "component.UseLocalHostAsDefaultHost" // UseLocalHostAsDefaultHostfeatureGate is the feature gate that controls whether // server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints. -var UseLocalHostAsDefaultHostfeatureGate = mustRegisterOrLoad( +var _ = mustRegisterOrLoad( featuregate.GlobalRegistry(), UseLocalHostAsDefaultHostID, - featuregate.StageBeta, + featuregate.StageStable, + featuregate.WithRegisterToVersion("v0.110.0"), featuregate.WithRegisterDescription("controls whether server-like receivers and extensions such as the OTLP receiver use localhost as the default host for their endpoints"), ) diff --git a/receiver/otlpreceiver/factory.go b/receiver/otlpreceiver/factory.go index 465dd7dc676..12fc5eb1d20 100644 --- a/receiver/otlpreceiver/factory.go +++ b/receiver/otlpreceiver/factory.go @@ -5,7 +5,6 @@ package otlpreceiver // import "go.opentelemetry.io/collector/receiver/otlprecei import ( "context" - "fmt" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configgrpc" @@ -13,7 +12,6 @@ import ( "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumerprofiles" - "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/internal/sharedcomponent" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metadata" @@ -21,9 +19,6 @@ import ( ) const ( - grpcPort = 4317 - httpPort = 4318 - defaultTracesURLPath = "/v1/traces" defaultMetricsURLPath = "/v1/metrics" defaultLogsURLPath = "/v1/logs" @@ -48,7 +43,7 @@ func createDefaultConfig() component.Config { Protocols: Protocols{ GRPC: &configgrpc.ServerConfig{ NetAddr: confignet.AddrConfig{ - Endpoint: endpointForPort(globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled(), grpcPort), + Endpoint: "localhost:4317", Transport: confignet.TransportTypeTCP, }, // We almost write 0 bytes, so no need to tune WriteBufferSize. @@ -56,7 +51,7 @@ func createDefaultConfig() component.Config { }, HTTP: &HTTPConfig{ ServerConfig: &confighttp.ServerConfig{ - Endpoint: endpointForPort(globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled(), httpPort), + Endpoint: "localhost:4318", }, TracesURLPath: defaultTracesURLPath, MetricsURLPath: defaultMetricsURLPath, @@ -165,12 +160,3 @@ func createProfiles( // When the receiver is shutdown it should be removed from this map so the same configuration // can be recreated successfully. var receivers = sharedcomponent.NewMap[*Config, *otlpReceiver]() - -// endpointForPort gets the endpoint for a given port using localhost or 0.0.0.0 depending on the feature gate. -func endpointForPort(useLocalHostAsDefault bool, port int) string { - host := "localhost" - if !useLocalHostAsDefault { - host = "0.0.0.0" - } - return fmt.Sprintf("%s:%d", host, port) -} diff --git a/receiver/otlpreceiver/factory_test.go b/receiver/otlpreceiver/factory_test.go index c77b19514b0..301c9e09de9 100644 --- a/receiver/otlpreceiver/factory_test.go +++ b/receiver/otlpreceiver/factory_test.go @@ -430,38 +430,3 @@ func TestCreateProfilesReceiver(t *testing.T) { }) } } - -func TestEndpointForPort(t *testing.T) { - tests := []struct { - port int - enabled bool - endpoint string - }{ - { - port: 4317, - enabled: false, - endpoint: "0.0.0.0:4317", - }, - { - port: 4317, - enabled: true, - endpoint: "localhost:4317", - }, - { - port: 0, - enabled: false, - endpoint: "0.0.0.0:0", - }, - { - port: 0, - enabled: true, - endpoint: "localhost:0", - }, - } - - for _, tt := range tests { - t.Run(tt.endpoint, func(t *testing.T) { - assert.Equal(t, endpointForPort(tt.enabled, tt.port), tt.endpoint) - }) - } -} diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 066f20662cd..aa948c3668f 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -18,7 +18,6 @@ require ( go.opentelemetry.io/collector/consumer v0.109.0 go.opentelemetry.io/collector/consumer/consumerprofiles v0.109.0 go.opentelemetry.io/collector/consumer/consumertest v0.109.0 - go.opentelemetry.io/collector/internal/globalgates v0.109.0 go.opentelemetry.io/collector/pdata v1.15.0 go.opentelemetry.io/collector/pdata/pprofile v0.109.0 go.opentelemetry.io/collector/pdata/testdata v0.109.0 @@ -40,7 +39,6 @@ require ( github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -60,7 +58,6 @@ require ( go.opentelemetry.io/collector/config/internal v0.109.1-0.20240916143658-74729e731d3b // indirect go.opentelemetry.io/collector/extension v0.109.0 // indirect go.opentelemetry.io/collector/extension/auth v0.109.0 // indirect - go.opentelemetry.io/collector/featuregate v1.15.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.0.0-20240923154032-388e56cdb156 // indirect go.opentelemetry.io/collector/pipeline v0.0.0-20240923154032-388e56cdb156 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.55.0 // indirect @@ -105,10 +102,6 @@ replace go.opentelemetry.io/collector/extension => ../../extension replace go.opentelemetry.io/collector/extension/auth => ../../extension/auth -replace go.opentelemetry.io/collector/featuregate => ../../featuregate - -replace go.opentelemetry.io/collector/internal/globalgates => ../../internal/globalgates - replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata @@ -129,13 +122,13 @@ replace go.opentelemetry.io/collector/component/componentstatus => ../../compone replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverprofiles -retract ( - v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 - v0.69.0 // Release failed, use v0.69.1 -) - replace go.opentelemetry.io/collector/pipeline => ../../pipeline replace go.opentelemetry.io/collector/internal/globalsignal => ../../internal/globalsignal replace go.opentelemetry.io/collector/component/componentprofiles => ../../component/componentprofiles + +retract ( + v0.76.0 // Depends on retracted pdata v1.0.0-rc10 module, use v0.76.1 + v0.69.0 // Release failed, use v0.69.1 +) diff --git a/receiver/otlpreceiver/go.sum b/receiver/otlpreceiver/go.sum index adff47b38ed..4f44455d26b 100644 --- a/receiver/otlpreceiver/go.sum +++ b/receiver/otlpreceiver/go.sum @@ -21,8 +21,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= diff --git a/service/service.go b/service/service.go index bf17b418398..83a8a12c848 100644 --- a/service/service.go +++ b/service/service.go @@ -24,7 +24,6 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/featuregate" - "go.opentelemetry.io/collector/internal/globalgates" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor" @@ -233,7 +232,6 @@ func (srv *Service) Start(ctx context.Context) error { } srv.telemetrySettings.Logger.Info("Everything is ready. Begin running and processing data.") - logAboutUseLocalHostAsDefault(srv.telemetrySettings.Logger) return nil } @@ -350,13 +348,3 @@ func pdataFromSdk(res *sdkresource.Resource) pcommon.Resource { } return pcommonRes } - -// logAboutUseLocalHostAsDefault logs about the upcoming change from 0.0.0.0 to localhost on server-like components. -func logAboutUseLocalHostAsDefault(logger *zap.Logger) { - if globalgates.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() { - logger.Info( - "The default endpoints for all servers in components have changed to use localhost instead of 0.0.0.0. Disable the feature gate to temporarily revert to the previous default.", - zap.String("feature gate ID", globalgates.UseLocalHostAsDefaultHostID), - ) - } -}