code: func NewUnaryServerInterceptor(next grpc.UnaryServerInterceptor) grpc.UnaryServerInterceptor {
  	return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
  		started := clock.Now(ctx)
  		panicing := true
  		defer func() {
  			// We don't want to recover anything, but we want to log Internal error
  			// in case of a panic. We pray here reportServerRPCMetrics is very
  			// lightweight and it doesn't panic itself.
  			code := codes.OK
  			switch {
  			case err != nil:
  				code = grpc.Code(err)
  			case panicing:
  				code = codes.Internal
  			}
  			reportServerRPCMetrics(ctx, info.FullMethod, code, clock.Now(ctx).Sub(started))
  		}()
  		if next != nil {
  			resp, err = next(ctx, req, info, handler)
  		} else {
  			resp, err = handler(ctx, req)
  		}
  		panicing = false // normal exit, no panic happened, disarms defer
  		return
  	}
  }
docs: // NewUnaryServerInterceptor returns an interceptor that gathers RPC handler
  // metrics and sends them to tsmon.
  //
  // It can be optionally chained with other interceptor. The reported metrics
  // include time spent in this other interceptor too.
  //
  // It assumes the RPC context has tsmon initialized already.