diff --git a/.chloggen/mx-psi_internal-localhostgate.yaml b/.chloggen/mx-psi_internal-localhostgate.yaml index cec1e3451f9a..7c423353d7a0 100755 --- a/.chloggen/mx-psi_internal-localhostgate.yaml +++ b/.chloggen/mx-psi_internal-localhostgate.yaml @@ -24,6 +24,7 @@ subtext: | - processor/remotetap - receiver/splunk_hec - receiver/awsxray + - receiver/influxdb # 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/influxdbreceiver/README.md b/receiver/influxdbreceiver/README.md index 81c7121d1f36..8fcffa9ed6dc 100644 --- a/receiver/influxdbreceiver/README.md +++ b/receiver/influxdbreceiver/README.md @@ -29,7 +29,8 @@ Write responses: The following configuration options are supported: -* `endpoint` (default = 0.0.0.0:8086) HTTP service endpoint for the line protocol receiver +* `endpoint` (default = 0.0.0.0:8086) HTTP service endpoint for the line protocol receiver. The + `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:8086. This will become the default in a future release. The full list of settings exposed for this receiver are documented in [config.go](config.go). diff --git a/receiver/influxdbreceiver/factory.go b/receiver/influxdbreceiver/factory.go index ac54e61c4a4f..d12555f91868 100644 --- a/receiver/influxdbreceiver/factory.go +++ b/receiver/influxdbreceiver/factory.go @@ -11,9 +11,12 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver/internal/metadata" ) +const defaultPort = 8086 + func NewFactory() receiver.Factory { return receiver.NewFactory( metadata.Type, @@ -25,7 +28,7 @@ func NewFactory() receiver.Factory { func createDefaultConfig() component.Config { return &Config{ HTTPServerConfig: confighttp.HTTPServerConfig{ - Endpoint: "0.0.0.0:8086", + Endpoint: localhostgate.EndpointForPort(defaultPort), }, } }