diff --git a/FORK.md b/FORK.md index 0136ec61ac4..b6a4c57bdcd 100644 --- a/FORK.md +++ b/FORK.md @@ -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` diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index e9d3ffc39e4..528ed77a562 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -224,13 +224,13 @@ func (gcs *ClientConfig) isSchemeHTTPS() bool { // a non-blocking dial (the function won't wait for connections to be // established, and connecting happens in the background). To make it a blocking // dial, use grpc.WithBlock() dial option. -func (gcs *ClientConfig) ToClientConn(_ context.Context, host component.Host, settings component.TelemetrySettings, extraOpts ...grpc.DialOption) (*grpc.ClientConn, error) { +func (gcs *ClientConfig) ToClientConn(ctx context.Context, host component.Host, settings component.TelemetrySettings, extraOpts ...grpc.DialOption) (*grpc.ClientConn, error) { opts, err := gcs.toDialOptions(host, settings) if err != nil { return nil, err } opts = append(opts, extraOpts...) - return grpc.NewClient(gcs.sanitizedEndpoint(), opts...) + return grpc.DialContext(ctx, gcs.sanitizedEndpoint(), opts...) //nolint } func (gcs *ClientConfig) toDialOptions(host component.Host, settings component.TelemetrySettings) ([]grpc.DialOption, error) {