Skip to content

Commit

Permalink
add finish timestamp to API interceptor (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
yebrahim authored and k8s-ci-robot committed Nov 27, 2018
1 parent 81f2df6 commit b528f50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/apiserver/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ import (
// to be executed before and after all API handler calls, e.g. Logging, error handling.
// For more details, see https://github.com/grpc/grpc-go/blob/master/interceptor.go
func apiServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
glog.Infof("%v called", info.FullMethod)
glog.Infof("%v handler starting", info.FullMethod)
resp, err = handler(ctx, req)
if err != nil {
util.LogError(util.Wrapf(err, "%s call failed", info.FullMethod))
// Convert error to gRPC errors
err = util.ToGRPCError(err)
return
}
glog.Infof("%v handler finished", info.FullMethod)
return
}

0 comments on commit b528f50

Please sign in to comment.