Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2020-02-06 01:38:44 +0300
committerJohn Cai <jcai@gitlab.com>2020-02-06 01:38:44 +0300
commitb80e07f886fd65772aa2824b7286db0059946532 (patch)
treee1574bd1d11e3aeb968869027cd1db402173cf93
parent1efc7522df86322e814c4f0fd6a47dbf37beeff5 (diff)
trying out client interceptorsjc-add-praefect-metrics
-rw-r--r--internal/praefect/conn/client_connections.go4
-rw-r--r--internal/praefect/coordinator.go16
2 files changed, 13 insertions, 7 deletions
diff --git a/internal/praefect/conn/client_connections.go b/internal/praefect/conn/client_connections.go
index d2e36f352..a78183603 100644
--- a/internal/praefect/conn/client_connections.go
+++ b/internal/praefect/conn/client_connections.go
@@ -4,6 +4,8 @@ import (
"errors"
"sync"
+ "gitlab.com/gitlab-org/gitaly/internal/middleware/proxytime"
+
gitalyauth "gitlab.com/gitlab-org/gitaly/auth"
"gitlab.com/gitlab-org/gitaly/client"
"gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy"
@@ -36,6 +38,8 @@ func (c *ClientConnections) RegisterNode(storageName, listenAddr, token string)
[]grpc.DialOption{
grpc.WithDefaultCallOptions(grpc.CallCustomCodec(proxy.Codec())),
grpc.WithPerRPCCredentials(gitalyauth.RPCCredentials(token)),
+ grpc.WithUnaryInterceptor(proxytime.UnaryProxyTime),
+ grpc.WithStreamInterceptor(proxytime.StreamProxyTime),
},
)
if err != nil {
diff --git a/internal/praefect/coordinator.go b/internal/praefect/coordinator.go
index 7aad8583b..8499fb0b2 100644
--- a/internal/praefect/coordinator.go
+++ b/internal/praefect/coordinator.go
@@ -10,7 +10,6 @@ import (
"syscall"
"gitlab.com/gitlab-org/gitaly/internal/helper"
- "gitlab.com/gitlab-org/gitaly/internal/metadata"
"gitlab.com/gitlab-org/gitaly/internal/middleware/proxytime"
"gitlab.com/gitlab-org/gitaly/internal/praefect/config"
"gitlab.com/gitlab-org/gitaly/internal/praefect/conn"
@@ -107,17 +106,20 @@ func (c *Coordinator) streamDirector(ctx context.Context, fullMethodName string,
return nil, fmt.Errorf("unable to find existing client connection for %s", storage)
}
- var opts []grpc.CallOption
- proxyRequestID := metadata.GetValue(ctx, proxytime.RequestIDKey)
- if proxyRequestID != "" {
- opts = append(opts, c.trailerTracker.Trailer(proxyRequestID))
- }
+ /*
+ var opts []grpc.CallOption
+ proxyRequestID := metadata.GetValue(ctx, proxytime.RequestIDKey)
+ if proxyRequestID != "" {
+ opts = append(opts, c.trailerTracker.Trailer(proxyRequestID))
+ }
+
+ */
return &StreamParameters{
ctx: helper.IncomingToOutgoing(ctx),
conn: cc,
reqFinalizer: requestFinalizer,
- callOptions: opts,
+ // callOptions: opts,
}, nil
}