|
@@ -158,6 +158,9 @@ func startGRPCProxy(cmd *cobra.Command, args []string) {
|
|
|
},
|
|
},
|
|
|
Encoding: "json",
|
|
Encoding: "json",
|
|
|
EncoderConfig: zap.NewProductionEncoderConfig(),
|
|
EncoderConfig: zap.NewProductionEncoderConfig(),
|
|
|
|
|
+
|
|
|
|
|
+ OutputPaths: []string{"stderr"},
|
|
|
|
|
+ ErrorOutputPaths: []string{"stderr"},
|
|
|
}
|
|
}
|
|
|
if grpcProxyDebug {
|
|
if grpcProxyDebug {
|
|
|
lcfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel)
|
|
lcfg.Level = zap.NewAtomicLevelAt(zap.DebugLevel)
|
|
@@ -195,7 +198,7 @@ func startGRPCProxy(cmd *cobra.Command, args []string) {
|
|
|
grpcl := m.Match(cmux.HTTP2())
|
|
grpcl := m.Match(cmux.HTTP2())
|
|
|
defer func() {
|
|
defer func() {
|
|
|
grpcl.Close()
|
|
grpcl.Close()
|
|
|
- lg.Info("stopping listening gRPC proxy client requests", zap.String("address", grpcProxyListenAddr))
|
|
|
|
|
|
|
+ lg.Info("stop listening gRPC proxy client requests", zap.String("address", grpcProxyListenAddr))
|
|
|
}()
|
|
}()
|
|
|
|
|
|
|
|
client := mustNewClient(lg)
|
|
client := mustNewClient(lg)
|
|
@@ -211,11 +214,18 @@ func startGRPCProxy(cmd *cobra.Command, args []string) {
|
|
|
mux := http.NewServeMux()
|
|
mux := http.NewServeMux()
|
|
|
etcdhttp.HandlePrometheus(mux)
|
|
etcdhttp.HandlePrometheus(mux)
|
|
|
grpcproxy.HandleHealth(mux, client)
|
|
grpcproxy.HandleHealth(mux, client)
|
|
|
|
|
+ lg.Info("gRPC proxy server metrics URL serving")
|
|
|
herr := http.Serve(mhttpl, mux)
|
|
herr := http.Serve(mhttpl, mux)
|
|
|
- lg.Fatal("gRPC proxy server serve returned", zap.Error(herr))
|
|
|
|
|
|
|
+ if herr != nil {
|
|
|
|
|
+ lg.Fatal("gRPC proxy server metrics URL returned", zap.Error(herr))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ lg.Info("gRPC proxy server metrics URL returned")
|
|
|
|
|
+ }
|
|
|
}()
|
|
}()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ lg.Info("started gRPC proxy", zap.String("address", grpcProxyListenAddr))
|
|
|
|
|
+
|
|
|
// grpc-proxy is initialized, ready to serve
|
|
// grpc-proxy is initialized, ready to serve
|
|
|
notifySystemd(lg)
|
|
notifySystemd(lg)
|
|
|
|
|
|