Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/influxdb] Use component.UseLocalHostAsDefaultHost feature gate #30912

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .chloggen/mx-psi_internal-localhostgate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion receiver/influxdbreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
5 changes: 4 additions & 1 deletion receiver/influxdbreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
},
}
}
Expand Down
Loading