diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2018-11-22 23:48:39 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-11-22 23:48:39 +0300 |
commit | 745bdb8d926d27bd46f14d2a18002940e897261e (patch) | |
tree | 64324728dc07cdf09c50753b6ffab19bc99b65da /internal/rubyserver | |
parent | 0cb101c5d6afa6a6dadd4dc701f056c3712ee692 (diff) |
Propagate correlation-ids in from upstream services and out to Gitaly-Ruby
Diffstat (limited to 'internal/rubyserver')
-rw-r--r-- | internal/rubyserver/rubyserver.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go index 99cb290a5..b163dc7bc 100644 --- a/internal/rubyserver/rubyserver.go +++ b/internal/rubyserver/rubyserver.go @@ -10,6 +10,7 @@ import ( "sync" "time" + "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/grpc-ecosystem/go-grpc-prometheus" log "github.com/sirupsen/logrus" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" @@ -21,6 +22,7 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/supervisor" "gitlab.com/gitlab-org/gitaly/internal/version" "gitlab.com/gitlab-org/gitaly/streamio" + grpccorrelation "gitlab.com/gitlab-org/labkit/correlation/grpc" "golang.org/x/net/context" "google.golang.org/grpc" ) @@ -253,7 +255,17 @@ func dialOptions() []grpc.DialOption { return []grpc.DialOption{ grpc.WithBlock(), // With this we get retries. Without, connections fail fast. grpc.WithInsecure(), - grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor), - grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor), + grpc.WithUnaryInterceptor( + grpc_middleware.ChainUnaryClient( + grpc_prometheus.UnaryClientInterceptor, + grpccorrelation.UnaryClientCorrelationInterceptor(), + ), + ), + grpc.WithStreamInterceptor( + grpc_middleware.ChainStreamClient( + grpc_prometheus.StreamClientInterceptor, + grpccorrelation.StreamClientCorrelationInterceptor(), + ), + ), } } |