Skip to content

Commit

Permalink
[common-go] Adjust log level and ping keepalive interval
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf authored and roboquat committed Oct 11, 2021
1 parent 4750a3f commit 7dabb61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/common-go/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func DefaultClientOptions() []grpc.DialOption {
Backoff: bfConf,
}),
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: 5 * time.Second,
Time: 10 * time.Second,
Timeout: time.Second,
PermitWithoutStream: true,
}),
Expand All @@ -85,7 +85,7 @@ func ServerOptionsWithInterceptors(stream []grpc.StreamServerInterceptor, unary
return []grpc.ServerOption{
// terminate the connection if the client pings more than once every 2 seconds
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
MinTime: 2 * time.Second,
MinTime: 10 * time.Second,
PermitWithoutStream: true,
}),
grpc.MaxRecvMsgSize(maxMsgSize),
Expand All @@ -101,7 +101,7 @@ func ServerOptionsWithInterceptors(stream []grpc.StreamServerInterceptor, unary

func SetupLogging() {
grpclog.SetLoggerV2(grpclog.NewLoggerV2(
log.WithField("component", "grpc").WriterLevel(logrus.InfoLevel),
log.WithField("component", "grpc").WriterLevel(logrus.DebugLevel),
log.WithField("component", "grpc").WriterLevel(logrus.WarnLevel),
log.WithField("component", "grpc").WriterLevel(logrus.ErrorLevel),
))
Expand Down

0 comments on commit 7dabb61

Please sign in to comment.