Skip to content

Commit

Permalink
ENG-48179: Revert to use DialContext in grpc client
Browse files Browse the repository at this point in the history
With NewClient API usage, we are facing issues at
few customers who have intermediate proxies between collector
and platform. With NewClient API instead Dial,
DNS resolution happens on the client side while it should happen on proxy.
Also, with SGProxy client does not get the correct certificate.
This can be changed once grpc fixes grpc/grpc-go#7556 and otel collector picks the fix
  • Loading branch information
puneet-traceable committed Sep 18, 2024
1 parent 9af37d4 commit 4c1990d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ git push --tags
- In `config/configgrpc/configgrpc.go` we added the ability to add extra `ClientDialOptionHandler`. Also a unit test for this in `config/configgrpc/configgrpcclientdialoptionhandler_test.go`. Also commented out warning on servers starting `UnspecifiedHost` aka `0.0.0.0`.
- In `config/configgrpc/configgrpc_test.go` we commented a unit test checking for a warning on servers starting `UnspecifiedHost` aka `0.0.0.0`.
- In `config/confighttp/confighttp.go` we commented out warning on servers starting `UnspecifiedHost`.
- In ` config/confighttp/confighttp_test.go` we commented a unit test checking for a warning on servers starting `UnspecifiedHost`.
- In `config/confighttp/confighttp_test.go` we commented a unit test checking for a warning on servers starting `UnspecifiedHost`.
- In `config/configgrpc/configgrpc.go` we reverted back to use `grpc.DialContext` method instead of `grpc.NewClient`
2 changes: 1 addition & 1 deletion config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (gcs *ClientConfig) ToClientConn(_ context.Context, host component.Host, se
return nil, err
}
opts = append(opts, extraOpts...)
return grpc.NewClient(gcs.sanitizedEndpoint(), opts...)
return grpc.DialContext(ctx, gcs.sanitizedEndpoint(), opts...)

Check failure on line 233 in config/configgrpc/configgrpc.go

View workflow job for this annotation

GitHub Actions / windows-unittest

undefined: ctx

Check failure on line 233 in config/configgrpc/configgrpc.go

View workflow job for this annotation

GitHub Actions / unittest-matrix (ubuntu-latest, ~1.22)

undefined: ctx

Check failure on line 233 in config/configgrpc/configgrpc.go

View workflow job for this annotation

GitHub Actions / test-coverage

undefined: ctx

Check failure on line 233 in config/configgrpc/configgrpc.go

View workflow job for this annotation

GitHub Actions / unittest-matrix (ubuntu-latest, ~1.21.11)

undefined: ctx
}

func (gcs *ClientConfig) toDialOptions(host component.Host, settings component.TelemetrySettings) ([]grpc.DialOption, error) {
Expand Down

0 comments on commit 4c1990d

Please sign in to comment.