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

[extension/awsproxy] awsproxy extension adopts component.UseLocalHostAsDefaultHost feature gate #30985

Merged
merged 2 commits into from
Feb 1, 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 @@ -27,6 +27,7 @@ subtext: |
- receiver/influxdb
- receiver/zookeeper
- receiver/signalfx
- extension/awsproxy
- receiver/sapm
- extension/jaegerremotesampling
- receiver/jaeger
Expand Down
3 changes: 3 additions & 0 deletions extension/awsproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ The TCP address and port on which this proxy listens for requests.

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.


### proxy_address (Optional)
Defines the proxy address that this extension forwards HTTP requests to the AWS backend through. If left unconfigured, requests will be sent directly.
This will generally be set to a NAT gateway when the collector is running on a network without public internet.
Expand Down
5 changes: 3 additions & 2 deletions extension/awsproxy/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import (

"github.com/open-telemetry/opentelemetry-collector-contrib/extension/awsproxy/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy"
"github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate"
)

const (
defaultEndpoint = "0.0.0.0:2000"
defaultPort = 2000
)

// NewFactory creates a factory for awsproxy extension.
Expand All @@ -33,7 +34,7 @@ func createDefaultConfig() component.Config {
return &Config{
ProxyConfig: proxy.Config{
TCPAddr: confignet.TCPAddr{
Endpoint: defaultEndpoint,
Endpoint: localhostgate.EndpointForPort(defaultPort),
},
TLSSetting: configtls.TLSClientSetting{
Insecure: false,
Expand Down
2 changes: 1 addition & 1 deletion extension/awsproxy/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestFactory_CreateDefaultConfig(t *testing.T) {
assert.Equal(t, &Config{
ProxyConfig: proxy.Config{
TCPAddr: confignet.TCPAddr{
Endpoint: defaultEndpoint,
Endpoint: "0.0.0.0:2000",
},
},
}, cfg)
Expand Down
Loading