diff --git a/.chloggen/mx-psi_internal-localhostgate.yaml b/.chloggen/mx-psi_internal-localhostgate.yaml index 79bfaaaa5e20..3e2dc2ae4b30 100755 --- a/.chloggen/mx-psi_internal-localhostgate.yaml +++ b/.chloggen/mx-psi_internal-localhostgate.yaml @@ -18,6 +18,7 @@ issues: [30702] subtext: | This change affects the following components: - receiver/loki + - receiver/awsfirehose # If your change doesn't affect end users or the exported elements of any package, # you should instead start your pull request title with [chore] or use the "Skip Changelog" label. diff --git a/receiver/awsfirehosereceiver/README.md b/receiver/awsfirehosereceiver/README.md index f0aade33a854..8619e21cc2f8 100644 --- a/receiver/awsfirehosereceiver/README.md +++ b/receiver/awsfirehosereceiver/README.md @@ -40,6 +40,8 @@ The address:port to bind the listener to. default: `0.0.0.0:4433` +The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:4433. This will become the default in a future release. + ### tls: See [documentation](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md#server-configuration) for more details. diff --git a/receiver/awsfirehosereceiver/factory.go b/receiver/awsfirehosereceiver/factory.go index 13c545c6245f..15d9738d5265 100644 --- a/receiver/awsfirehosereceiver/factory.go +++ b/receiver/awsfirehosereceiver/factory.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/receiver" "go.uber.org/zap" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/unmarshaler" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/unmarshaler/cwmetricstream" @@ -21,6 +22,7 @@ import ( const ( defaultRecordType = cwmetricstream.TypeStr defaultEndpoint = "0.0.0.0:4433" + defaultPort = 4433 ) var ( @@ -63,7 +65,7 @@ func createDefaultConfig() component.Config { return &Config{ RecordType: defaultRecordType, HTTPServerSettings: confighttp.HTTPServerSettings{ - Endpoint: defaultEndpoint, + Endpoint: localhostgate.EndpointForPort(defaultPort), }, } } diff --git a/receiver/awsfirehosereceiver/go.mod b/receiver/awsfirehosereceiver/go.mod index 95ab4d09283e..279dd19cdd23 100644 --- a/receiver/awsfirehosereceiver/go.mod +++ b/receiver/awsfirehosereceiver/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfir go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.93.1-0.20240125183026-3cacd40b27e8 go.opentelemetry.io/collector/config/confighttp v0.93.1-0.20240125183026-3cacd40b27e8 @@ -82,3 +83,5 @@ retract ( v0.76.1 v0.65.0 ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common