func (ctx *prometheusClient) Instrument(serverLabel string) func(next http.Handler) http.Handler {
	return func(next http.Handler) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
			start := time.Now()
			reqSz := computeApproximateRequestSize(r)
			sw := statusWriter{ResponseWriter: w}
			next.ServeHTTP(&sw, r)
			status := strconv.Itoa(sw.status)
			elapsed := float64(time.Since(start)) / float64(time.Second)
			resSz := float64(sw.length)
			ctx.reqDur.WithLabelValues(serverLabel, status, r.Method, r.Host, r.URL.Path).Observe(elapsed)
			ctx.reqCnt.WithLabelValues(serverLabel, status, r.Method, r.Host, r.URL.Path).Inc()
			ctx.reqSz.WithLabelValues(serverLabel, status, r.Method, r.Host, r.URL.Path).Observe(float64(reqSz))
			ctx.resSz.WithLabelValues(serverLabel, status, r.Method, r.Host, r.URL.Path).Observe(resSz)
		})
	}
}
Instrument will instrument gin routes.
package metrics
import (
	"net/http"
	"strconv"
	"time"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
)
type prometheusClient struct {
	reqCnt             *prometheus.CounterVec
	resSz              *prometheus.SummaryVec
	reqDur             *prometheus.SummaryVec
	reqSz              *prometheus.SummaryVec
	up                 *prometheus.GaugeVec
	s3OperationsTotal  *prometheus.CounterVec
	authenticatedTotal *prometheus.CounterVec
	authorizedTotal    *prometheus.CounterVec
	succeedWebhooks    *prometheus.CounterVec
	failedWebhooks     *prometheus.CounterVec
}