Merge pull request #12908 from ptabor/20210429-client-retry-logging

Clientv3 (retry interceptor) logs should use the configured logger
This commit is contained in:
Piotr Tabor
2021-04-29 19:25:04 +02:00
committed by GitHub
40 changed files with 117 additions and 83 deletions

View File

@@ -15,8 +15,9 @@
package auth
import (
"github.com/prometheus/client_golang/prometheus"
"sync"
"github.com/prometheus/client_golang/prometheus"
)
var (

View File

@@ -288,7 +288,7 @@ func mustNewClient(lg *zap.Logger) *clientv3.Client {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
return client
return client.WithLogger(lg.Named("client"))
}
func mustNewProxyClient(lg *zap.Logger, tls *transport.TLSInfo) *clientv3.Client {
@@ -304,7 +304,7 @@ func mustNewProxyClient(lg *zap.Logger, tls *transport.TLSInfo) *clientv3.Client
os.Exit(1)
}
lg.Info("create proxy client", zap.String("grpcProxyAdvertiseClientURL", grpcProxyAdvertiseClientURL))
return client
return client.WithLogger(lg.Named("client"))
}
func newProxyClientCfg(lg *zap.Logger, eps []string, tls *transport.TLSInfo) (*clientv3.Config, error) {

View File

@@ -15,11 +15,10 @@
package v2http
import (
"net/http"
"strconv"
"time"
"net/http"
"go.etcd.io/etcd/api/v3/etcdserverpb"
"go.etcd.io/etcd/server/v3/etcdserver/api/v2error"
"go.etcd.io/etcd/server/v3/etcdserver/api/v2http/httptypes"

View File

@@ -17,15 +17,16 @@ package etcdserver
import (
"bytes"
"fmt"
"go.etcd.io/etcd/client/pkg/v3/logutil"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"time"
"go.etcd.io/etcd/client/pkg/v3/logutil"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func TestNewRaftLogger(t *testing.T) {