refactor(zrpc): prefer static config for zrpc server statinterceptor (#3105)

This commit is contained in:
cong
2023-04-08 21:03:32 +08:00
committed by GitHub
parent 2e6402f4b5
commit 49135fe25e
5 changed files with 171 additions and 15 deletions

View File

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