@@ -147,21 +147,28 @@ func run() {
147147 MinVersion : tls .VersionTLS12 ,
148148 })
149149
150+ grpcLogDeciderFunc := func (methodFullName string , err error ) bool {
151+ if err == nil && methodFullName == "/grpc.health.v1.Health/Check" {
152+ return false
153+ }
154+ return true
155+ }
156+
150157 opts := []grpc.ServerOption {
151158 // Enable TLS for all incoming connections.
152159 grpc .Creds (creds ),
153160 grpc .StreamInterceptor (grpc_middleware .ChainStreamServer (
154161 grpc_ctxtags .StreamServerInterceptor (),
155162 grpc_prometheus .StreamServerInterceptor ,
156- grpc_zap .StreamServerInterceptor (logger ),
163+ grpc_zap .StreamServerInterceptor (logger , grpc_zap . WithDecider ( grpcLogDeciderFunc ) ),
157164 grpc_auth .StreamServerInterceptor (auther .Auth ),
158165 grpc_internalerror .StreamServerInterceptor (),
159166 grpc_recovery .StreamServerInterceptor (),
160167 )),
161168 grpc .UnaryInterceptor (grpc_middleware .ChainUnaryServer (
162169 grpc_ctxtags .UnaryServerInterceptor (),
163170 grpc_prometheus .UnaryServerInterceptor ,
164- grpc_zap .UnaryServerInterceptor (logger ),
171+ grpc_zap .UnaryServerInterceptor (logger , grpc_zap . WithDecider ( grpcLogDeciderFunc ) ),
165172 grpc_auth .UnaryServerInterceptor (auther .Auth ),
166173 grpc_internalerror .UnaryServerInterceptor (),
167174 grpc_recovery .UnaryServerInterceptor (),
0 commit comments