Skip to content

Commit e524edf

Browse files
add prometheus metrics route
1 parent 82d9cb9 commit e524edf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/handlers/server.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
_ "github.com/nevzattalhaozcan/forgotten/docs" // swag doc import
55
"github.com/swaggo/gin-swagger"
66
"github.com/swaggo/files"
7-
7+
"github.com/prometheus/client_golang/prometheus/promhttp"
88
"net/http"
99

1010
"github.com/gin-contrib/cors"
@@ -47,6 +47,7 @@ func (s *Server) setupRoutes() {
4747

4848
if s.config.Server.Environment != "production" {
4949
s.router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
50+
s.router.GET("/metrics", gin.WrapH(promhttp.Handler()))
5051
}
5152

5253
api := s.router.Group("/api/v1")

0 commit comments

Comments
 (0)