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

Switch from localhost to 0.0.0.0 by default for all receivers #1006

Merged
merged 8 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Receivers typically listen on a network port and receive telemetry data. Usually
```yaml
receivers:
opencensus:
endpoint: "localhost:55678"
endpoint: "0.0.0.0:55678"

service:
pipelines:
Expand Down Expand Up @@ -78,7 +78,7 @@ exporters:
opencensus/1:
endpoint: "example.com:14250"
opencensus/2:
endpoint: "localhost:14250"
endpoint: "0.0.0.0:14250"
```

Usually an exporter gets the data from one pipeline, however it is possible to configure multiple pipelines to send data to the same exporter, e.g.:
Expand All @@ -88,7 +88,7 @@ exporters:
jaeger:
protocols:
grpc:
endpoint: "localhost:14250"
endpoint: "0.0.0.0:14250"

service:
pipelines:
Expand Down
4 changes: 2 additions & 2 deletions docs/service-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ extensions:
health_check:
port: 13133
pprof:
endpoint: "localhost:1777"
endpoint: "0.0.0.0:1777"
flands marked this conversation as resolved.
Show resolved Hide resolved
block_profile_fraction: 0
mutex_profile_fraction: 0
zpages:
endpoint: "localhost:55679"
endpoint: "0.0.0.0:55679"
flands marked this conversation as resolved.
Show resolved Hide resolved

# The service lists extensions not directly related to data pipelines, but used
# by the service.
Expand Down
6 changes: 3 additions & 3 deletions examples/demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ docker-compose up -d

The demo exposes the following backends:

- Jaeger at http://localhost:16686
- Zipkin at http://localhost:9411
- Prometheus at http://localhost:9090
- Jaeger at http://0.0.0.0:16686
- Zipkin at http://0.0.0.0:9411
- Prometheus at http://0.0.0.0:9090

Notes:

Expand Down
4 changes: 2 additions & 2 deletions exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Example:
```yaml
exporters:
opencensus:
endpoint: localhost:14250
endpoint: 0.0.0.0:14250
reconnection_delay: 60s
secure: false
```
Expand Down Expand Up @@ -147,7 +147,7 @@ Example:
```yaml
exporters:
otlp:
endpoint: localhost:14250
endpoint: 0.0.0.0:14250
reconnection_delay: 60s
secure: false
```
Expand Down
10 changes: 4 additions & 6 deletions extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ investigate issues with the service.

The following settings are required:

- `endpoint` (default = localhost:1777): The endpoint in which the pprof will
be listening to. Use localhost:<port> to make it available only locally, or
":<port>" to make it available on all network interfaces.
- `endpoint` (default = 0.0.0.0:1777): The endpoint in which the pprof will
flands marked this conversation as resolved.
Show resolved Hide resolved
be listening to.
- `block_profile_fraction` (default = 0): Fraction of blocking events that
are profiled. A value <= 0 disables profiling. See
https://golang.org/pkg/runtime/#SetBlockProfileRate for details.
Expand Down Expand Up @@ -83,9 +82,8 @@ All core exporters and receivers provide some zPage instrumentation.

The following settings are required:

- `endpoint` (default = localhost:55679): Specifies the HTTP endpoint that serves
zPages. Use localhost:<port> to make it available only locally, or ":<port>" to
make it available on all network interfaces.
- `endpoint` (default = 0.0.0.0:55679): Specifies the HTTP endpoint that serves
flands marked this conversation as resolved.
Show resolved Hide resolved
zPages.

Example:
```yaml
Expand Down
2 changes: 0 additions & 2 deletions extension/pprofextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ type Config struct {
configmodels.ExtensionSettings `mapstructure:",squash"`

// Endpoint is the address and port in which the pprof will be listening to.
// Use localhost:<port> to make it available only locally, or ":<port>" to
// make it available on all network interfaces.
Endpoint string `mapstructure:"endpoint"`

// Fraction of blocking events that are profiled. A value <= 0 disables
Expand Down
2 changes: 1 addition & 1 deletion extension/pprofextension/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (f *Factory) CreateDefaultConfig() configmodels.Extension {
TypeVal: typeStr,
NameVal: typeStr,
},
Endpoint: "localhost:1777",
Endpoint: "0.0.0.0:1777",
flands marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
2 changes: 1 addition & 1 deletion extension/pprofextension/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestFactory_CreateDefaultConfig(t *testing.T) {
NameVal: typeStr,
TypeVal: typeStr,
},
Endpoint: "localhost:1777",
Endpoint: "0.0.0.0:1777",
},
cfg)

Expand Down
2 changes: 0 additions & 2 deletions extension/zpagesextension/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@ type Config struct {
configmodels.ExtensionSettings `mapstructure:",squash"`

// Endpoint is the address and port in which the zPages will be listening to.
// Use localhost:<port> to make it available only locally, or ":<port>" to
// make it available on all network interfaces.
Endpoint string `mapstructure:"endpoint"`
}
2 changes: 1 addition & 1 deletion extension/zpagesextension/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (f *Factory) CreateDefaultConfig() configmodels.Extension {
TypeVal: typeStr,
NameVal: typeStr,
},
Endpoint: "localhost:55679",
flands marked this conversation as resolved.
Show resolved Hide resolved
Endpoint: "0.0.0.0:55679",
}
}

Expand Down
2 changes: 1 addition & 1 deletion extension/zpagesextension/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestFactory_CreateDefaultConfig(t *testing.T) {
NameVal: typeStr,
TypeVal: typeStr,
},
Endpoint: "localhost:55679",
Endpoint: "0.0.0.0:55679",
},
cfg)

Expand Down
16 changes: 8 additions & 8 deletions receiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ receivers:
# <receiver type>/<name>:
examplereceiver/settings:
# <setting two>: <value two>
endpoint: localhost:9211
endpoint: 0.0.0.0:9211
```

A receiver instance is referenced by its full name in other parts of the config,
Expand Down Expand Up @@ -95,7 +95,7 @@ receivers:
tls_credentials:
key_file: /key.pem # path to private key
cert_file: /cert.pem # path to certificate
endpoint: "localhost:9876"
endpoint: "0.0.0.0:9876"
```

### Remote Sampling
Expand Down Expand Up @@ -181,7 +181,7 @@ specifying a list of allowed CORS origins in the `cors_allowed_origins` field:
```yaml
receivers:
opencensus:
endpoint: "localhost:55678"
endpoint: "0.0.0.0:55678"
cors_allowed_origins:
- http://test.com
# Origins can have wildcards with *, use * by itself to match any origin.
Expand Down Expand Up @@ -235,7 +235,7 @@ specifying a list of allowed CORS origins in the `cors_allowed_origins` field:
```yaml
receivers:
otlp:
endpoint: "localhost:55680"
endpoint: "0.0.0.0:55680"
cors_allowed_origins:
- http://test.com
# Origins can have wildcards with *, use * by itself to match any origin.
Expand Down Expand Up @@ -336,12 +336,12 @@ receivers:
- job_name: 'opencensus_service'
scrape_interval: 5s
static_configs:
- targets: ['localhost:8889']
- targets: ['0.0.0.0:8889']

- job_name: 'jdbc_apps'
scrape_interval: 3s
static_configs:
- targets: ['localhost:9777']
- targets: ['0.0.0.0:9777']
```

### Include Filter
Expand All @@ -359,8 +359,8 @@ of the metrics from the targets will be dropped.
receivers:
prometheus:
include_filter: {
"localhost:9777" : [http/server/server_latency, custom_metric1],
"localhost:9778" : [http/client/roundtrip_latency],
"0.0.0.0:9777" : [http/server/server_latency, custom_metric1],
"0.0.0.0:9778" : [http/client/roundtrip_latency],
}
config:
scrape_configs:
Expand Down
8 changes: 4 additions & 4 deletions receiver/jaegerreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ const (
protoThriftCompact = "thrift_compact"

// Default endpoints to bind to.
defaultGRPCBindEndpoint = "localhost:14250"
defaultHTTPBindEndpoint = "localhost:14268"
defaultGRPCBindEndpoint = "0.0.0.0:14250"
defaultHTTPBindEndpoint = "0.0.0.0:14268"

defaultThriftCompactBindEndpoint = "localhost:6831"
defaultThriftBinaryBindEndpoint = "localhost:6832"
defaultThriftCompactBindEndpoint = "0.0.0.0:6831"
defaultThriftBinaryBindEndpoint = "0.0.0.0:6832"
defaultAgentRemoteSamplingHTTPPort = 5778
)

Expand Down
8 changes: 4 additions & 4 deletions receiver/opencensusreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "opencensus/keepalive",
Endpoint: "localhost:55678",
Endpoint: "0.0.0.0:55678",
},
TLSCredentials: nil,
Transport: "tcp",
Expand All @@ -85,7 +85,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "opencensus/msg-size-conc-connect-max-idle",
Endpoint: "localhost:55678",
Endpoint: "0.0.0.0:55678",
},

Transport: "tcp",
Expand All @@ -106,7 +106,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "opencensus/tlscredentials",
Endpoint: "localhost:55678",
Endpoint: "0.0.0.0:55678",
},
TLSCredentials: &configtls.TLSSetting{
CertFile: "test.crt",
Expand All @@ -121,7 +121,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "opencensus/cors",
Endpoint: "localhost:55678",
Endpoint: "0.0.0.0:55678",
},
Transport: "tcp",
CorsOrigins: []string{"https://*.test.com", "https://test.com"},
Expand Down
2 changes: 1 addition & 1 deletion receiver/opencensusreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (f *Factory) CreateDefaultConfig() configmodels.Receiver {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: typeStr,
Endpoint: "localhost:55678",
Endpoint: "0.0.0.0:55678",
},
Transport: "tcp",
}
Expand Down
10 changes: 5 additions & 5 deletions receiver/otlpreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "otlp/customname",
Endpoint: "0.0.0.0:9090",
Endpoint: "localhost:9090",
},
Transport: "tcp",
})
Expand All @@ -60,7 +60,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "otlp/keepalive",
Endpoint: "localhost:55680",
Endpoint: "0.0.0.0:55680",
},
TLSCredentials: nil,
Transport: "tcp",
Expand All @@ -85,7 +85,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "otlp/msg-size-conc-connect-max-idle",
Endpoint: "localhost:55680",
Endpoint: "0.0.0.0:55680",
},
Transport: "tcp",
MaxRecvMsgSizeMiB: 32,
Expand All @@ -105,7 +105,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "otlp/tlscredentials",
Endpoint: "localhost:55680",
Endpoint: "0.0.0.0:55680",
},
TLSCredentials: &configtls.TLSSetting{
CertFile: "test.crt",
Expand All @@ -120,7 +120,7 @@ func TestLoadConfig(t *testing.T) {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: "otlp/cors",
Endpoint: "localhost:55680",
Endpoint: "0.0.0.0:55680",
},
Transport: "tcp",
CorsOrigins: []string{"https://*.test.com", "https://test.com"},
Expand Down
2 changes: 1 addition & 1 deletion receiver/otlpreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (f *Factory) CreateDefaultConfig() configmodels.Receiver {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: typeStr,
Endpoint: "localhost:55680",
Endpoint: "0.0.0.0:55680",
},
Transport: "tcp",
}
Expand Down
4 changes: 2 additions & 2 deletions receiver/otlpreceiver/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ receivers:
# This configuration is of type 'otlp' and has the name 'customname' with a full name of 'otlp/customname'
# ('<type>/<name>'. To reference this configuration in a pipeline, use the full name `otlp/customname`.
otlp/customname:
# The receiver will listen on endpoint: "0.0.0.0:9090".
endpoint: 0.0.0.0:9090
# The receiver will listen on endpoint: "localhost:9090".
endpoint: localhost:9090
# The following entry configures all of the keep alive settings. These settings are used to configure the receiver.
otlp/keepalive:
keepalive:
Expand Down
2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (f *Factory) CreateDefaultConfig() configmodels.Receiver {
ReceiverSettings: configmodels.ReceiverSettings{
TypeVal: typeStr,
NameVal: typeStr,
Endpoint: "localhost:9090",
Endpoint: "0.0.0.0:9090",
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion receiver/vmmetricsreceiver/example_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ zpages:
exporters:
prometheus:
namespace: "vmmetrics_test"
address: "localhost:8888"
address: "0.0.0.0:8888"
2 changes: 1 addition & 1 deletion receiver/zipkinreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
// The value of "type" key in configuration.
typeStr = "zipkin"

defaultBindEndpoint = "localhost:9411"
defaultBindEndpoint = "0.0.0.0:9411"
)

// Factory is the factory for Zipkin receiver.
Expand Down