diff options
author | Igor Wiedler <iwiedler@gitlab.com> | 2020-03-11 11:09:55 +0300 |
---|---|---|
committer | Igor Wiedler <iwiedler@gitlab.com> | 2020-03-11 11:09:55 +0300 |
commit | b0cb86002a823481b97944b51288a7e588bacae9 (patch) | |
tree | acbbf1835aafd0ead15f91eb56a58cc5986a3b5a | |
parent | aa910b0b6fbc3f005a9924dee731123dfca2e48d (diff) |
praefect: include tracing middleware on client
-rw-r--r-- | internal/praefect/nodes/manager.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/praefect/nodes/manager.go b/internal/praefect/nodes/manager.go index d45affbfe..fc816ddd6 100644 --- a/internal/praefect/nodes/manager.go +++ b/internal/praefect/nodes/manager.go @@ -6,6 +6,7 @@ import ( "sync" "time" + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/sirupsen/logrus" gitalyauth "gitlab.com/gitlab-org/gitaly/auth" @@ -13,6 +14,7 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/praefect/config" "gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy" "gitlab.com/gitlab-org/gitaly/internal/praefect/models" + grpctracing "gitlab.com/gitlab-org/labkit/tracing/grpc" "google.golang.org/grpc" healthpb "google.golang.org/grpc/health/grpc_health_v1" ) @@ -88,8 +90,14 @@ func NewManager(log *logrus.Entry, c config.Config, dialOpts ...grpc.DialOption) []grpc.DialOption{ grpc.WithDefaultCallOptions(grpc.CallCustomCodec(proxy.Codec())), grpc.WithPerRPCCredentials(gitalyauth.RPCCredentials(node.Token)), - grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor), - grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor), + grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient( + grpc_prometheus.StreamClientInterceptor, + grpctracing.StreamClientTracingInterceptor(), + )), + grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient( + grpc_prometheus.UnaryClientInterceptor, + grpctracing.UnaryClientTracingInterceptor(), + )), }, dialOpts...), ) if err != nil { |