I have currently learnt about ismorphism. What dazzles me is that the definitions to not seem to match perfectly. The usual definition that I find is:
Let $\boldsymbol A = (A,(f_i))$ and $\boldsymbol B = (B,(g_i))$ be two algebraic structures of the same type $(m_i),$ such that $m_i \in \mathbb{N}_0$ for each $i$ names the arity of the fundamental operations $f_i$ and $g_i$. Each $m$-ary operation is a special $m+1$-ary homogeneous relation. A relation $\varphi\colon A \to B$ is an isomorphism of $\boldsymbol A$ in $\boldsymbol B,$ if it is bijective and for each $i$ and for each $a_1,\ldots,a_{m_i} \in A$ it holds that
$g_i(\varphi(a_1),\ldots,\varphi(a_{m_i})) = \varphi(f_i(a_1,\ldots,a_{m_i}))$
Clear, understood. Now, we could define some metric spaces (that are merely special cases of some algebraic structure [or maybe I am wrong here?]) $\boldsymbol{A}, \boldsymbol{B}$ with metrics $f_i, g_i$, respectively. Again, lets have the same type $(m_i)$. Now, if I have translated the definition of isometry correctly to our setting, it says that a relation $\varphi: A \rightarrow B$ is an isometry if it holds that:
$g_i\left(\varphi(a_1),\varphi(a_2)\right)=f_i(a_1,a_2)$
It is just intuitive by looking at the results that there is no $\varphi$ on the right-hand side because we would like to have equal distances. However, it does not match the definition in the first formula for the isomorphism in general above. And sources seem to be consistent in that they say that an isometry is an isomorphism, also called isometric isomorphism oftentimes.
So, is the first definition (first formula in my post) just no general definition or did I miss anything here?