What's $\mathbb{R}$ doing in the definition of a metric space? 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.
 A: Flagg in "Quantales and continuity spaces" defines the notion of a value quantale, a certain complete lattice satisfying a short list of very reasonable properties. He then goes on to define a continuity space to be precisely what you are suggesting: a metric space valued in a value quantale. The classic notion is recovered since $[0, \infty ]$ is a value quantale. There are many other value quantales giving rise to truly different kinds of 'metric spaces'. 
Flagg's work builds on previous work of Kopperman where he essentially did the same thing but used a value semigroup instead of a value quantale. There are some distinct differences between the two approaches. For instance, defining point-to-set distance in the usual (obvious) way, in Flagg's formalism the point-to-set distance from $x$ to $C$ is $0$ if, and only if, $x$ belongs to the usual topological closure of $C$. This property does not hold in Kopperman's formalism. Also, in both formalisms every topological space becomes metrisable, but only in Flagg's formalism does this result extend to an equivalence of categories between the usual category of topological spaces and the category of all continuity spaces with (classically defined $\epsilon - \delta$) continuous functions. 
With these remarks answering precisely which aspects of metric spaces deeply depend on the specifics of $\mathbb R$ is (I believe) not a very simple question to answer. For instance, many properties of classical metric spaces (e.g., compactness being equivalent to sequential compactness) can be seen to be a result of certain properties of the value quantale $[0,\infty]$, so again not really deeply relying on $\mathbb R$ since other value quantales share these properties. 
The value quantale $[0,\infty ]$ does have a special role in the theory of value quantales though I can't (yet) refer to any published work (or preprint). In a nutshell, every value quantale embeds into a suitable type of power of $[0,\infty]$, so every value quantale has a dimension over $[0,\infty ]$ (possibly infinite dimension, of course).  
A: There has been some research on metrics whose "distance values" belong to a lattice ordered group:
Topologies arising from metrics valued in abelian
$\ell$-groups by Ralph Kopperman, Homeira Pajoohesh, and Tom Richmond (2011) preprint version
Metric spaces with distances in a lattice ordered group by P. Ranga Rao (1978)
There are also the notions of a $k$-metric space and a cone metric space, on which several papers have recently been published.
A: I agree with you. In fact in the definition of a metric space we have $\left[ 0,\infty\right)$ https://en.wikipedia.org/wiki/Metric_(mathematics).  
The notion of total order has the idea that we can order the elements of the set on a line remember for example that there is no total order in the complex numbers, at the same time we need completeness to take distance in $\mathbb{R}$ in a good way, so it looks like whatever you put you will need a kind of $\left[ 0,\infty\right)$ contained there.
You can use the unitary circle $S^{1}$ instead of $\mathbb{R}$ passing through this sets with a homeomorphism that send $\mathbb{R}$ to $S^{1}$ minus $(-1,0)$ taking for example $(-1,0)$ as $\infty$ and $(1,0)$ as the zero and using the addition induced by the map $e^{\theta}$. But in my opinion this change is not so useful, basically I am only changing $\mathbb{R}$ by a curve.
I am not saying that your question is not good, I am only saying that maybe the notion that we wanna construct leaves the set $\left[ 0,\infty\right)$ as the only option.
