zsais / go-gin-prometheus

Gin Web Framework Prometheus metrics exporter
MIT License
450 stars 133 forks source link

requests_total metric not found #55

Open dayadev opened 1 year ago

dayadev commented 1 year ago

I am using go-gin-prometheus as a middleware with the default metrics and a couple of custom metrics that I registered but when I look at the metrics in my /metrics endpoint, I do not see a requests_total metric in there. Should I be implementing this like a custom metrics?


 func Use(engine *gin.Engine, port string) {
     prometheus.MustRegister(commonMetrics.ComponentProcessingTime)
     prometheus.MustRegister(commonMetrics.ComponentConsumerFailures)
     ginCol := ginprometheus.NewPrometheus("gin")
     ginCol.SetListenAddress(":" + port)
     ginCol.Use(engine)
}