Add prometheus metrics

This commit is contained in:
2025-08-13 11:17:35 +03:00
parent 22cbaf0bca
commit eb0dea6113
6 changed files with 110 additions and 3 deletions

View File

@@ -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",