Add prometheus metrics
This commit is contained in:
4
main.go
4
main.go
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/joho/godotenv"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/pressly/goose/v3"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -132,6 +133,9 @@ func main() {
|
||||
})
|
||||
})
|
||||
|
||||
// Добавляем эндпоинт для метрик Prometheus
|
||||
router.GET("/metrics", gin.WrapH(promhttp.Handler()))
|
||||
|
||||
// Создаем HTTP сервер
|
||||
srv := &http.Server{
|
||||
Addr: ":8080",
|
||||
|
Reference in New Issue
Block a user