From 3710083dc398b6e0922ab06b56022f1e8d4eba45 Mon Sep 17 00:00:00 2001 From: Jille Timmermans Date: Sun, 16 Jan 2022 16:46:50 +0100 Subject: [PATCH] retry_interceptor.go: Log the method that failed When getting warnings from the retry_interceptors that RPCs failed, they provide very little context as to what exactly failed. I used this patch to try debugging https://groups.google.com/g/etcd-dev/c/3hxxr9ktdpM. --- client/v3/retry_interceptor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/v3/retry_interceptor.go b/client/v3/retry_interceptor.go index 2b5d26c8f..36d24687d 100644 --- a/client/v3/retry_interceptor.go +++ b/client/v3/retry_interceptor.go @@ -54,6 +54,7 @@ func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClien c.GetLogger().Debug( "retrying of unary invoker", zap.String("target", cc.Target()), + zap.String("method", method), zap.Uint("attempt", attempt), ) lastErr = invoker(ctx, method, req, reply, cc, grpcOpts...) @@ -63,6 +64,7 @@ func (c *Client) unaryClientInterceptor(optFuncs ...retryOption) grpc.UnaryClien c.GetLogger().Warn( "retrying of unary invoker failed", zap.String("target", cc.Target()), + zap.String("method", method), zap.Uint("attempt", attempt), zap.Error(lastErr), )