Metric spaces and completely monotone functions