TITLE: Necessity of the use of reals in the metric definition
QUESTION [9 upvotes]: A metric $d$ is a function $d:X \times X \to \mathbb{R}$ such that $d(x,y)\geq 0$ and equals $0$ iff $x=y$. $d(x,y)=d(y,x)$ and the triangle inequality holds. From these requirements, the only things that are used is that the codomain has a $0$, a $+$ operation and a linear order. So, it seems, we could in principle define a metric by a function $d: X \times X \to G$ such the same expressions hold, and where $G$ is an ordered group.
My question is, what usual theorems do we lose by picking that definition? In particular, some key questions come to mind

If there is a metric on a space $X$, when allowing for other groups in the codomain, does that imply there is a metric with codomain $\mathbb{R}$? That is, does the collection of metrizable spaces expand with the new definition?
A kind of converse to the previous one, for any infinite ordered group $G$, if there is metric with codomain $\mathbb R$, is there necessarily one with codomain $G$ that generates the same topology? (it being infinite is necessary as the trivial group satisfies all the metric properties but always generates the discrete topology).

REPLY [8 votes]: Kopperman's approach was already mentioned in the answers. There is also Flagg's "Quantales and continuity spaces" (alg. univ., 1997). Flagg uses a value quantale as the codomain of the metric. The two approaches are quite different. A main technical difference is that Kopperman's value semigroups require specifying the collection of elements that act as the positive elements. Flagg's value quantales come equipped with a notion of being positive (i.e., well above the bottom element).
Both approaches yield the theorem: For all topological spaces $(X,\tau )$ there is a value semigroup/quantale and a metrisation of $X$ whose induced open ball topology is $\tau$, and in fact a functor $\mathcal O$ from the suitably defined category of generalised metric spaces and continuous functions, to the usual category of topological spaces. But only in Flagg's formalism this functor $\mathcal O$ is an equivalence of categories ("A note on the metrizability of spaces", alg. univ., 2015).
A survey of what happens when one does topology along this functor can be found in "The topology of a quantale valued metric space", FSS, 2020). Perhaps interesting is the theorem that in that formalism not only is there an equivalence between usual topology and this category of metric spaces, but in fact the open ball topology functor is the unique equivalence between these categories, when these are considered as concrete over $\mathbf {Set}$. This is a way to see that the usual open ball topology construction is not ad-hoc.