From 55c28fd5f439a38e2ae70d5e12d91dc0f04ec3e6 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 31 May 2023 12:30:46 +0300 Subject: [PATCH] [#412] cache: Pass DialOptions to create new conn Signed-off-by: Dmitrii Stepanov --- pkg/network/cache/multi.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/network/cache/multi.go b/pkg/network/cache/multi.go index b8a0aa4bc..ba81df16c 100644 --- a/pkg/network/cache/multi.go +++ b/pkg/network/cache/multi.go @@ -10,8 +10,11 @@ import ( rawclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" clientcore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client" "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network" + metrics "git.frostfs.info/TrueCloudLab/frostfs-observability/metrics/grpc" + tracing "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing/grpc" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" + "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -72,6 +75,17 @@ func (x *multiClient) createForAddress(ctx context.Context, addr network.Address prmInit.SetResponseInfoCallback(x.opts.ResponseCallback) } + prmDial.SetGRPCDialOptions( + grpc.WithChainUnaryInterceptor( + metrics.NewUnaryClientInterceptor(), + tracing.NewUnaryClientInteceptor(), + ), + grpc.WithChainStreamInterceptor( + metrics.NewStreamClientInterceptor(), + tracing.NewStreamClientInterceptor(), + ), + ) + c.Init(prmInit) err := c.Dial(ctx, prmDial) if err != nil {