A metric space is often defined as a set $X$ along with a mapping $d: X^2\rightarrow\mathbb R$ obeying the following identities: \begin{align*} &d(x,y)=0 \Leftrightarrow x=y, \\ &d(x,y)=d(y,x), \\ &d(x,z) \leq d(x,y)+d(y,z). \end{align*} This definition demands that $d$ map into $\mathbb R$. I find this interesting because only a few properties of $\mathbb R$ are necessary to make those three identities make sense $-$ presumably you could define something analogous to a metric space by replacing $\mathbb R$ with another set $A$, so long as $A$ has some sort of order, some notion of addition, and an additive identity $0$.
What sort of things are lost in such a generalization? Surely something falls apart if $A$ does not have a total order. Additionally, I imagine the completeness of $\mathbb R$ is important as well. But I don't have any specific examples. And I cannot really figure out why we need the field $\mathbb R$ rather than just some group or ring.
So my question is: what attributes of metric spaces depend on $d$ mapping into $\mathbb R$ rather than another, possibly quite similar, space? (e.g., ordered fields that are not complete; or complete totally ordered groups.) While there are some questions on the site discussing generalizations along the lines I've described (such as this one) they focus on the aspects of metric spaces that don't depend on $\mathbb R$, whereas I'm interested in the ones that do.