refactor: simplify zrpc stat config (#3107)

This commit is contained in:
Kevin Wan
2023-04-08 22:45:05 +08:00
committed by GitHub
parent e13fd62d38
commit 98c9b5928a
6 changed files with 36 additions and 35 deletions

View File

@@ -113,11 +113,8 @@ func (s *rpcServer) buildUnaryInterceptors() []grpc.UnaryServerInterceptor {
interceptors = append(interceptors, serverinterceptors.UnaryRecoverInterceptor)
}
if s.middlewares.Stat {
interceptors = append(interceptors, serverinterceptors.UnaryStatInterceptor(s.metrics,
serverinterceptors.StatConf{
SlowThreshold: s.middlewares.StatSlowThreshold,
NotLoggingContentMethods: s.middlewares.NotLoggingContentMethods,
}))
interceptors = append(interceptors,
serverinterceptors.UnaryStatInterceptor(s.metrics, s.middlewares.StatConf))
}
if s.middlewares.Prometheus {
interceptors = append(interceptors, serverinterceptors.UnaryPrometheusInterceptor)