From 4fd5eb12f123222b38f13d673326cbe07a7110d5 Mon Sep 17 00:00:00 2001 From: Ivan Ou Date: Tue, 29 Mar 2022 17:01:56 +0800 Subject: [PATCH] feature: add interceptor lab --- cmd/comment/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/comment/api.go b/cmd/comment/api.go index 5f76112..3c76307 100644 --- a/cmd/comment/api.go +++ b/cmd/comment/api.go @@ -99,7 +99,9 @@ func runAPI(_ *cobra.Command, _ []string) error { } }() - return runkit.GracefulRun(serveGRPC(lis, svc, logger, grpc.UnaryInterceptor(meter.UnaryServerInterceptor())), &args.GracefulConfig) + // add interceptor here to update metrics + // TODO + return runkit.GracefulRun(serveGRPC(lis, svc, logger), &args.GracefulConfig) } func serveGRPC(lis net.Listener, svc pb.CommentServer, logger *logkit.Logger, opt ...grpc.ServerOption) runkit.GracefulRunFunc {