  Trace classes of Sobolev-type functions in metric spaces are subject of this
paper. In particular, functions on domains whose boundary has an upper
codimension-$\theta$ bound are considered. Based on a Poincar\'e inequality,
existence of a Borel measurable trace is proven whenever the power of
integrability of the "gradient" exceeds $\theta$. The trace $T$ is shown to be
a compact operator mapping a Sobolev-type space on a domain into a Besov space
on the boundary. Sufficient conditions for $T$ to be surjective are found and
counterexamples showing that surjectivity may fail are also provided. The case
when the exponent of integrability of the "gradient" is equal to $\theta$,
i.e., the codimension of the boundary, is also discussed. Under some additional
assumptions, the trace lies in $L^\theta$ on the boundary then. Essential
sharpness of these extra assumptions is illustrated by an example.
