From 018acd8bd5c11570bb4fc1bb39954cae8df466ea Mon Sep 17 00:00:00 2001 From: Fabrizio Ferri-Benedetti Date: Wed, 31 Jan 2024 16:04:05 +0100 Subject: [PATCH] Replace or add loopback address in Collector OTLP examples (#3847) --- .../building/authenticator-extension.md | 2 ++ .../en/docs/collector/building/connector.md | 4 +-- .../en/docs/collector/building/receiver.md | 2 ++ content/en/docs/collector/configuration.md | 33 ++++++++++++++++--- content/en/docs/collector/deployment/agent.md | 3 ++ .../en/docs/collector/deployment/gateway.md | 3 ++ content/en/docs/collector/scaling.md | 2 ++ content/en/docs/faas/lambda-collector.md | 4 +-- content/en/docs/kubernetes/operator/_index.md | 2 ++ .../en/docs/kubernetes/operator/automatic.md | 2 ++ content/en/docs/languages/js/exporters.md | 2 ++ content/en/docs/languages/python/distro.md | 2 ++ content/en/docs/languages/python/exporters.md | 2 ++ .../docs/languages/python/getting-started.md | 3 ++ 14 files changed, 57 insertions(+), 9 deletions(-) diff --git a/content/en/docs/collector/building/authenticator-extension.md b/content/en/docs/collector/building/authenticator-extension.md index 45cb4d524ce..5980e0b07c7 100644 --- a/content/en/docs/collector/building/authenticator-extension.md +++ b/content/en/docs/collector/building/authenticator-extension.md @@ -78,6 +78,7 @@ receivers: otlp/auth: protocols: grpc: + endpoint: 0.0.0.0:4317 auth: authenticator: oidc @@ -107,6 +108,7 @@ receivers: otlp/auth: protocols: grpc: + endpoint: 0.0.0.0:4317 auth: authenticator: oidc/some-provider diff --git a/content/en/docs/collector/building/connector.md b/content/en/docs/collector/building/connector.md index aa828a993c4..9f2c8f80f18 100644 --- a/content/en/docs/collector/building/connector.md +++ b/content/en/docs/collector/building/connector.md @@ -87,9 +87,9 @@ receivers: otlp: protocols: grpc: - endpoint: localhost:4317 + endpoint: 0.0.0.0:4317 http: - endpoint: localhost:4318 + endpoint: 0.0.0.0:4318 exporters: # NOTE: Prior to v0.86.0 use the `logging` instead of `debug`. diff --git a/content/en/docs/collector/building/receiver.md b/content/en/docs/collector/building/receiver.md index a5aeff3d5e3..a5dfc6a0623 100644 --- a/content/en/docs/collector/building/receiver.md +++ b/content/en/docs/collector/building/receiver.md @@ -108,6 +108,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 processors: batch: @@ -1035,6 +1036,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 tailtracer: # this line represents the ID of your receiver interval: 1m number_of_traces: 1 diff --git a/content/en/docs/collector/configuration.md b/content/en/docs/collector/configuration.md index 6d4be5622ba..6e6c8c62c43 100644 --- a/content/en/docs/collector/configuration.md +++ b/content/en/docs/collector/configuration.md @@ -38,16 +38,31 @@ which provide capabilities that can be added to the Collector, such as diagnostic tools. Extensions don't require direct access to telemetry data and are enabled through the [service](#service) section. -The following is an example of Collector configuration with a receiver, a -processor, an exporter, and three extensions: + The following is an example of Collector +configuration with a receiver, a processor, an exporter, and three extensions. + +{{% alert title="Important" color="warning" %}} + +While it is generally preferable to bind endpoints to `localhost` when all +clients are local, our example configurations use the "unspecified" address +`0.0.0.0` as a convenience. The Collector currently defaults to `0.0.0.0`, but +the default will be changed to `localhost` in the near future. For details +concerning either of these choices as endpoint configuration value, see +[Safeguards against denial of service attacks]. + +[Safeguards against denial of service attacks]: + https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md#safeguards-against-denial-of-service-attacks + +{{% /alert %}} ```yaml receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: - + endpoint: 0.0.0.0:4318 processors: batch: @@ -87,7 +102,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 otlp/2: protocols: grpc: @@ -137,6 +154,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 exporters: ${file:exporters.yaml} @@ -163,6 +181,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 exporters: otlp: @@ -217,6 +236,7 @@ receivers: jaeger: protocols: grpc: + endpoint: 0.0.0.0:4317 thrift_binary: thrift_compact: thrift_http: @@ -232,7 +252,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 # Data sources: metrics prometheus: @@ -392,7 +414,7 @@ exporters: # Data sources: metrics prometheus: - endpoint: localhost:8889 + endpoint: 0.0.0.0:8889 namespace: default # Data sources: metrics @@ -723,6 +745,7 @@ receivers: otlp/auth: protocols: grpc: + endpoint: 0.0.0.0:4317 auth: authenticator: oidc @@ -758,7 +781,7 @@ receivers: otlp: protocols: grpc: - endpoint: localhost:4317 + endpoint: 0.0.0.0:4317 processors: diff --git a/content/en/docs/collector/deployment/agent.md b/content/en/docs/collector/deployment/agent.md index 5c63759a2d4..6db6d6b233e 100644 --- a/content/en/docs/collector/deployment/agent.md +++ b/content/en/docs/collector/deployment/agent.md @@ -43,6 +43,7 @@ receivers: otlp: # the OTLP receiver the app is sending traces to protocols: grpc: + endpoint: 0.0.0.0:4317 processors: batch: @@ -66,6 +67,7 @@ receivers: otlp: # the OTLP receiver the app is sending metrics to protocols: grpc: + endpoint: 0.0.0.0:4317 processors: batch: @@ -89,6 +91,7 @@ receivers: otlp: # the OTLP receiver the app is sending logs to protocols: grpc: + endpoint: 0.0.0.0:4317 processors: batch: diff --git a/content/en/docs/collector/deployment/gateway.md b/content/en/docs/collector/deployment/gateway.md index 5276e0f2a04..e4d7f03cf72 100644 --- a/content/en/docs/collector/deployment/gateway.md +++ b/content/en/docs/collector/deployment/gateway.md @@ -118,6 +118,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 exporters: loadbalancing: @@ -146,6 +147,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 exporters: loadbalancing: @@ -171,6 +173,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 exporters: loadbalancing: diff --git a/content/en/docs/collector/scaling.md b/content/en/docs/collector/scaling.md index c6f35723ff6..c6335eb9ca2 100644 --- a/content/en/docs/collector/scaling.md +++ b/content/en/docs/collector/scaling.md @@ -157,6 +157,7 @@ spec: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 processors: exporters: @@ -360,6 +361,7 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 processors: diff --git a/content/en/docs/faas/lambda-collector.md b/content/en/docs/faas/lambda-collector.md index 4a9dbc0ccae..bc6cee1daae 100644 --- a/content/en/docs/faas/lambda-collector.md +++ b/content/en/docs/faas/lambda-collector.md @@ -53,9 +53,9 @@ receivers: otlp: protocols: grpc: - endpoint: 'localhost:4317' + endpoint: '0.0.0.0:4317' http: - endpoint: 'localhost:4318' + endpoint: '0.0.0.0:4318' exporters: # NOTE: Prior to v0.86.0 use `logging` instead of `debug`. diff --git a/content/en/docs/kubernetes/operator/_index.md b/content/en/docs/kubernetes/operator/_index.md index 75a07ff191a..6f1e26ed48a 100644 --- a/content/en/docs/kubernetes/operator/_index.md +++ b/content/en/docs/kubernetes/operator/_index.md @@ -49,7 +49,9 @@ spec: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 processors: exporters: diff --git a/content/en/docs/kubernetes/operator/automatic.md b/content/en/docs/kubernetes/operator/automatic.md index 6a424436223..80be3926188 100644 --- a/content/en/docs/kubernetes/operator/automatic.md +++ b/content/en/docs/kubernetes/operator/automatic.md @@ -68,7 +68,9 @@ spec: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 processors: memory_limiter: check_interval: 1s diff --git a/content/en/docs/languages/js/exporters.md b/content/en/docs/languages/js/exporters.md index 0c29bd3241e..b70b1f0fe92 100644 --- a/content/en/docs/languages/js/exporters.md +++ b/content/en/docs/languages/js/exporters.md @@ -37,7 +37,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 exporters: debug: verbosity: detailed diff --git a/content/en/docs/languages/python/distro.md b/content/en/docs/languages/python/distro.md index c79a9f6f9a4..4f43dfcd6dc 100644 --- a/content/en/docs/languages/python/distro.md +++ b/content/en/docs/languages/python/distro.md @@ -38,7 +38,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 exporters: # NOTE: Prior to v0.86.0 use `logging` instead of `debug`. debug: diff --git a/content/en/docs/languages/python/exporters.md b/content/en/docs/languages/python/exporters.md index b0c79d636f5..07c33a782c8 100644 --- a/content/en/docs/languages/python/exporters.md +++ b/content/en/docs/languages/python/exporters.md @@ -40,7 +40,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 http: + endpoint: 0.0.0.0:4318 exporters: debug: verbosity: detailed diff --git a/content/en/docs/languages/python/getting-started.md b/content/en/docs/languages/python/getting-started.md index b9e291389f9..28385e345a7 100644 --- a/content/en/docs/languages/python/getting-started.md +++ b/content/en/docs/languages/python/getting-started.md @@ -663,6 +663,9 @@ receivers: otlp: protocols: grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 exporters: # NOTE: Prior to v0.86.0 use `logging` instead of `debug`. debug: