Skip to content

Commit

Permalink
[receiver/signalfx] signalfxreceiver adopts `component.UseLocalHostAs…
Browse files Browse the repository at this point in the history
…DefaultHost` feature gate (#30906)

**Description:**
signalfxreceiver adopts `component.UseLocalHostAsDefaultHost` feature
gate

**Link to tracking Issue:**
#30702 

**Documentation:**
Updated docs.
  • Loading branch information
atoulme authored Jan 31, 2024
1 parent 688aca5 commit 6ea2340
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .chloggen/mx-psi_internal-localhostgate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ subtext: |
- receiver/awsxray
- receiver/influxdb
- receiver/zookeeper
- receiver/signalfx
# 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
1 change: 1 addition & 0 deletions receiver/signalfxreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The following settings are required:

- `endpoint` (default = `0.0.0.0:9943`): Address and port that the SignalFx
receiver should bind to.
The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:9943. This will become the default in a future release.

The following settings are optional:

Expand Down
2 changes: 1 addition & 1 deletion receiver/signalfxreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestLoadConfig(t *testing.T) {
id: component.NewIDWithName(metadata.Type, "tls"),
expected: &Config{
HTTPServerConfig: confighttp.HTTPServerConfig{
Endpoint: ":9943",
Endpoint: "0.0.0.0:9943",
TLSSetting: &configtls.TLSServerSetting{
TLSSetting: configtls.TLSSetting{
CertFile: "/test.crt",
Expand Down
7 changes: 4 additions & 3 deletions receiver/signalfxreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ 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/signalfxreceiver/internal/metadata"
)

// This file implements factory for SignalFx receiver.

const (

// Default endpoints to bind to.
defaultEndpoint = ":9943"
// Default port to bind to.
defaultPort = 9943
)

// NewFactory creates a factory for SignalFx receiver.
Expand All @@ -38,7 +39,7 @@ func NewFactory() receiver.Factory {
func createDefaultConfig() component.Config {
return &Config{
HTTPServerConfig: confighttp.HTTPServerConfig{
Endpoint: defaultEndpoint,
Endpoint: localhostgate.EndpointForPort(defaultPort),
},
}
}
Expand Down

0 comments on commit 6ea2340

Please sign in to comment.