func PromAddRequestDuration(sc int, m string, d time.Duration) {
	RequestDuration.With(prometheus.Labels{"code": fmt.Sprintf("%v", sc), "method": m}).Set(d.Seconds())
}
PromAddRequestDuration append request duration for
a given return code and http method
package server
import (
	"fmt"
	"net/http"
	"time"
	"github.com/julienschmidt/httprouter"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promauto"
	"github.com/prometheus/client_golang/prometheus/promhttp"
)
const (
	MetricsPrefix = "loginapp_"
)
var (
	TotalRequestCounter = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: MetricsPrefix + "request_total",
		Help: "The total number of http request",
	}, []string{"code", "method"})
	RequestDuration = promauto.NewGaugeVec(prometheus.GaugeOpts{
		Name: MetricsPrefix + "request_duration",
		Help: "Duration of http request in seconds",
	}, []string{"code", "method"})
)
func PrometheusMetrics(port int) error {
	pr := func() *httprouter.Router {
		r := httprouter.New()
		r.Handler("GET", "/metrics", promhttp.Handler())
		return r
	}
	if err := fmt.Errorf("%v", http.ListenAndServe(fmt.Sprintf(":%v", port), LoggingHandler(pr()))); err != nil {
		return err
	}
	return nil
}
func PromIncRequest(sc int, m string) {
	TotalRequestCounter.With(prometheus.Labels{"code": fmt.Sprintf("%v", sc), "method": m}).Inc()
}