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

[receiver/opencensus] Use component.UseLocalHostAsDefaultHost feature gate #30817

Merged
merged 4 commits into from
Jan 30, 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 @@ -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,
Expand Down
1 change: 1 addition & 0 deletions exporter/logzioexporter/example/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
receivers:
opencensus:
endpoint: :55678
zipkin:
endpoint: :9411
jaeger:
Expand Down
4 changes: 3 additions & 1 deletion receiver/opencensusreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion receiver/opencensusreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.
Expand Down
Loading