code: func InstrumentHandlerCounter(counter *prometheus.CounterVec, next http.Handler) http.HandlerFunc {
  	code, method := checkLabels(counter)
  
  	if code {
  		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  			d := newDelegator(w, nil)
  			next.ServeHTTP(d, r)
  			counter.With(labels(code, method, r.Method, d.Status())).Inc()
  		})
  	}
  
  	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
  		next.ServeHTTP(w, r)
  		counter.With(labels(code, method, r.Method, 0)).Inc()
  	})
  }
docs: // InstrumentHandlerCounter is a middleware that wraps the provided http.Handler
  // to observe the request result with the provided CounterVec.  The CounterVec
  // must have zero, one, or two non-const non-curried labels. For those, the only
  // allowed label names are "code" and "method". The function panics
  // otherwise. Partitioning of the CounterVec happens by HTTP status code and/or
  // HTTP method if the respective instance label names are present in the
  // CounterVec. For unpartitioned counting, use a CounterVec with zero labels.
  //
  // If the wrapped Handler does not set a status code, a status code of 200 is assumed.
  //
  // If the wrapped Handler panics, the Counter is not incremented.
  //
  // See the example for InstrumentHandlerDuration for example usage.