Skip to content

Commit 8b8f610

Browse files
authored
[receiver/influxdb] Use component.UseLocalHostAsDefaultHost feature gate (open-telemetry#30912)
**Description:** Fixes open-telemetry#30911
1 parent cfe22a0 commit 8b8f610

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.chloggen/mx-psi_internal-localhostgate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ subtext: |
2424
- processor/remotetap
2525
- receiver/splunk_hec
2626
- receiver/awsxray
27+
- receiver/influxdb
2728
2829
# If your change doesn't affect end users or the exported elements of any package,
2930
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

receiver/influxdbreceiver/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Write responses:
2929

3030
The following configuration options are supported:
3131

32-
* `endpoint` (default = 0.0.0.0:8086) HTTP service endpoint for the line protocol receiver
32+
* `endpoint` (default = 0.0.0.0:8086) HTTP service endpoint for the line protocol receiver. The
33+
`component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:8086. This will become the default in a future release.
3334

3435
The full list of settings exposed for this receiver are documented in [config.go](config.go).
3536

receiver/influxdbreceiver/factory.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ import (
1111
"go.opentelemetry.io/collector/consumer"
1212
"go.opentelemetry.io/collector/receiver"
1313

14+
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate"
1415
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influxdbreceiver/internal/metadata"
1516
)
1617

18+
const defaultPort = 8086
19+
1720
func NewFactory() receiver.Factory {
1821
return receiver.NewFactory(
1922
metadata.Type,
@@ -25,7 +28,7 @@ func NewFactory() receiver.Factory {
2528
func createDefaultConfig() component.Config {
2629
return &Config{
2730
HTTPServerConfig: confighttp.HTTPServerConfig{
28-
Endpoint: "0.0.0.0:8086",
31+
Endpoint: localhostgate.EndpointForPort(defaultPort),
2932
},
3033
}
3134
}

0 commit comments

Comments
 (0)