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/awsxray] Use component.UseLocalHostAsDefaultHost feature gate #30824

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 @@ -23,6 +23,7 @@ subtext: |
- receiver/awsfirehose
- processor/remotetap
- receiver/splunk_hec
- receiver/awsxray

# 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
2 changes: 2 additions & 0 deletions receiver/awsxrayreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ The UDP address and port on which this receiver listens for X-Ray segment docume

Default: `0.0.0.0:2000`

The `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:2000. This will become the default in a future release.

### transport (Optional)
This should always be "udp" as X-Ray SDKs only send segments using UDP.

Expand Down
7 changes: 4 additions & 3 deletions receiver/awsxrayreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import (
"go.opentelemetry.io/collector/receiver"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/udppoller"
)

const defaultPort = 2000

// NewFactory creates a factory for AWS receiver.
func NewFactory() receiver.Factory {
return receiver.NewFactory(
Expand All @@ -29,10 +32,8 @@ func createDefaultConfig() component.Config {
// in the X-Ray daemon:
// https://github.com/aws/aws-xray-daemon/blob/master/pkg/cfg/cfg.go#L99
return &Config{
// X-Ray daemon defaults to 127.0.0.1:2000 but
// the default in OT is 0.0.0.0.
NetAddr: confignet.NetAddr{
Endpoint: "0.0.0.0:2000",
Endpoint: localhostgate.EndpointForPort(defaultPort),
Transport: udppoller.Transport,
},
ProxyServer: proxy.DefaultConfig(),
Expand Down
Loading