proxy/grpcproxy/metrics.go
func HandleMetrics(mux *http.ServeMux, c *http.Client, eps []string) {
	// random shuffle endpoints
	r := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
	if len(eps) > 1 {
		eps = shuffleEndpoints(r, eps)
	}

	pathMetrics := etcdhttp.PathMetrics
	mux.HandleFunc(pathMetrics, func(w http.ResponseWriter, r *http.Request) {
		target := fmt.Sprintf("%s%s", eps[0], pathMetrics)
		if !strings.HasPrefix(target, "http") {
			scheme := "http"
			if r.TLS != nil {
				scheme = "https"
			}
			target = fmt.Sprintf("%s://%s", scheme, target)
		}

		resp, err := c.Get(target)
		if err != nil {
			http.Error(w, "Internal server error", http.StatusInternalServerError)
		}
		defer resp.Body.Close()
		w.Header().Set("Content-Type", "text/plain; version=0.0.4")
		body, _ := ioutil.ReadAll(resp.Body)
		fmt.Fprintf(w, "%s", body)
	})
}
func HandleMetrics(mux *http.ServeMux, c *http.Client, eps []string) {
	// random shuffle endpoints
	r := rand.New(rand.NewSource(int64(time.Now().Nanosecond())))
	if len(eps) > 1 {
		eps = shuffleEndpoints(r, eps)
	}

	pathMetrics := etcdhttp.PathMetrics
	mux.HandleFunc(pathMetrics, func(w http.ResponseWriter, r *http.Request) {
		target := fmt.Sprintf("%s%s", eps[0], pathMetrics)
		if !strings.HasPrefix(target, "http") {
			scheme := "http"
			if r.TLS != nil {
				scheme = "https"
			}
			target = fmt.Sprintf("%s://%s", scheme, target)
		}

		resp, err := c.Get(target)
		if err != nil {
			http.Error(w, "Internal server error", http.StatusInternalServerError)
		}
		defer resp.Body.Close()
		w.Header().Set("Content-Type", "text/plain; version=0.0.4")
		body, _ := ioutil.ReadAll(resp.Body)
		fmt.Fprintf(w, "%s", body)
	})
}
// HandleMetrics performs a GET request against etcd endpoint and returns '/metrics'.