Skip to content

Commit

Permalink
[extension/awsproxy] awsproxy extension adopts `component.UseLocalHos…
Browse files Browse the repository at this point in the history
…tAsDefaultHost` feature gate (open-telemetry#30985)

Description:
awsproxy extension adopts `component.UseLocalHostAsDefaultHost` feature
gate

Link to tracking Issue:

open-telemetry#30702

Fixes
open-telemetry#30984

Documentation:
Updated docs.

Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
  • Loading branch information
2 people authored and cparkins committed Feb 1, 2024
1 parent 9f4ad54 commit f605ed9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 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 @@ -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

0 comments on commit f605ed9

Please sign in to comment.