Let $\mathbb H$ be the upper half plane. The hyperbolic metric comes from a Riemannian metric on $\mathbb H$: at each point $z = x+iy \in \mathbb H$, the tangent space $T_z(\mathbb H)$ has a natural identification with $\mathbb R^2$, and we define a real inner product on $T_z(\mathbb H)$ by the formula
$$\langle v,w \rangle_z = \frac{v \cdot w}{y^2}$$ where $v \cdot w$ denotes the standard dot product in $\mathbb R^2$. This gives a norm $||v||_z$ in $T_z(\mathbb H)$. The hyperbolic metric in $\mathbb H$ is defined by
$$d(z_1,z_2) = \inf\limits_{\gamma} \int_0^1 ||\gamma'(t)||_{\gamma(t)}dt= \inf\limits_{\gamma} \int_0^1 \frac{\sqrt{x'(t)^2 + y'(t)^2}}{y(t)}dt$$
as $\gamma(t) = x(t) + i y(t)$ runs over all smooth curves $[0,1] \rightarrow \mathbb H$ satisfying $\gamma(0) = z_1, \gamma(1) = z_2$.
Some textbooks I've seen have said "We define the hyperbolic metric by the formula $ds = \frac{\sqrt{dx^2 + dy^2}}{y}$." What in the world does this mean? I don't know what $ds$ means in this context (it doesn't appear to be a differential form), or what it a priori has to do with a metric. Is this abuse of notation for the definition I gave above, or does it actually mean something?