diff --git a/.chloggen/mx-psi_internal-localhostgate.yaml b/.chloggen/mx-psi_internal-localhostgate.yaml index a9733957bfee..a7c44830be6d 100755 --- a/.chloggen/mx-psi_internal-localhostgate.yaml +++ b/.chloggen/mx-psi_internal-localhostgate.yaml @@ -18,6 +18,7 @@ issues: [30702] subtext: | This change affects the following components: - receiver/loki + - receiver/opencensus - receiver/zipkin # If your change doesn't affect end users or the exported elements of any package, diff --git a/exporter/logzioexporter/example/config.yaml b/exporter/logzioexporter/example/config.yaml index 2e11ba7d6c05..57f47ffd4b4c 100644 --- a/exporter/logzioexporter/example/config.yaml +++ b/exporter/logzioexporter/example/config.yaml @@ -1,5 +1,6 @@ receivers: opencensus: + endpoint: :55678 zipkin: endpoint: :9411 jaeger: diff --git a/receiver/opencensusreceiver/README.md b/receiver/opencensusreceiver/README.md index f285f0f44333..5e8b87d451a3 100644 --- a/receiver/opencensusreceiver/README.md +++ b/receiver/opencensusreceiver/README.md @@ -34,7 +34,9 @@ The following settings are configurable: - `endpoint` (default = 0.0.0.0:55678): host:port to which the receiver is going to receive data. The valid syntax is described at - https://github.com/grpc/grpc/blob/master/doc/naming.md. + https://github.com/grpc/grpc/blob/master/doc/naming.md. The + `component.UseLocalHostAsDefaultHost` feature gate changes this to localhost:55678. This will become the default in a future release. + ## Advanced Configuration diff --git a/receiver/opencensusreceiver/factory.go b/receiver/opencensusreceiver/factory.go index 4b505fe670f5..dfe3d209faae 100644 --- a/receiver/opencensusreceiver/factory.go +++ b/receiver/opencensusreceiver/factory.go @@ -12,10 +12,13 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/localhostgate" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver/internal/metadata" ) +const grpcPort = 55678 + // NewFactory creates a new OpenCensus receiver factory. func NewFactory() receiver.Factory { return receiver.NewFactory( @@ -29,7 +32,7 @@ func createDefaultConfig() component.Config { return &Config{ GRPCServerSettings: configgrpc.GRPCServerSettings{ NetAddr: confignet.NetAddr{ - Endpoint: "0.0.0.0:55678", + Endpoint: localhostgate.EndpointForPort(grpcPort), Transport: "tcp", }, // We almost write 0 bytes, so no need to tune WriteBufferSize.