From 736504c6bc9dae3eea3932e6c4645acf0ee9498e Mon Sep 17 00:00:00 2001 From: Puneet Agarwal Date: Tue, 17 Sep 2024 19:50:13 +0530 Subject: [PATCH] ENG-48179: Revert NewClient api usage in configgrpc. With NewClient API usage, we are facing issues at few customers who have intermediate proxies between collector and platform. With NewClient API instead DialContext, DNS resolution happens on the client side while it should happen on proxy. Also, with SGProxy client does not get the correct certificate. can be changed once grpc fixes https://github.com/grpc/grpc-go/issues/7556 and otel collector picks the fix --- config/configgrpc/configgrpc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index e64b87142ca..4837482a1f3 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -224,7 +224,7 @@ func (gcs *ClientConfig) ToClientConn(ctx context.Context, host component.Host, return nil, err } opts = append(opts, extraOpts...) - return grpc.NewClient(gcs.sanitizedEndpoint(), opts...) + return grpc.DialContext(ctx, gcs.sanitizedEndpoint(), opts...) } func (gcs *ClientConfig) toDialOptions(ctx context.Context, host component.Host, settings component.TelemetrySettings) ([]grpc.DialOption, error) {