Let Omega be an open set in a metric space H, 1 <= p(0), p <= q < infinity, a, b, gamma is an element of R, a >= 0. Suppose sigma, mu, w are Borel measures. Combining results from earlier work (2009) with those obtained in work with Wheeden (2011) and with Rodney and Wheeden (2013), we study embedding and compact embed- ding theorems of sets S subset of(1)(sigma,loc)(Omega) x L-w(p)(Omega) to L mu(p)(Omega) (projection to the first component) where S (abstract Sobolev space) satisfies a Poincare-type inequality, sigma satisfies certain weak doubling property and mu is absolutely continuous with respect to sigma. In particular, when H = R-n, w, mu, rho are weights so that rho is essentially constant on each ball deep inside in Omega\ F, and F is a finite collection of points and hyperplanes. With the help of a simple observation, we apply our result to the study of embedding and compact embedding of L-rho gamma(P0)(Omega) boolean AND E-w rho(b)p(Omega) and weighted fractional Sobolev spaces to L-mu rho a(q)(Omega) where E-w rho b(p)(Omega) is the space of locally integrable functions in 52 w such that their weak derivatives are in L-w rho b(p)(Omega). In R-n, our assumptions are mostly sharp. Besides extending numerous results in the literature, we also extend a result of Bourgain et al. (2002) on cubes to John domains.