diff --git a/internal/utils/validator.go b/internal/utils/validator.go index 04cbbc3..af78da4 100644 --- a/internal/utils/validator.go +++ b/internal/utils/validator.go @@ -57,7 +57,7 @@ func validateReservedKeywords(fl validator.FieldLevel) bool { name := fl.Field().String() restrictedNames := map[string]struct{}{} - for _, restrictedName := range []string{"assets", "register", "login", "logout", "settings", "admin-panel", "all", "search", "init", "healthcheck", "preview"} { + for _, restrictedName := range []string{"assets", "register", "login", "logout", "settings", "admin-panel", "all", "search", "init", "healthcheck", "preview", "metrics"} { restrictedNames[restrictedName] = struct{}{} } diff --git a/internal/web/healthcheck.go b/internal/web/healthcheck.go index c814361..6927d28 100644 --- a/internal/web/healthcheck.go +++ b/internal/web/healthcheck.go @@ -23,3 +23,9 @@ func healthcheck(ctx echo.Context) error { "time": time.Now().Format(time.RFC3339), }) } + +// metrics is a dummy handler to satisfy the /metrics endpoint (for Prometheus, Openmetrics, etc.) +// until we have a proper metrics endpoint +func metrics(ctx echo.Context) error { + return ctx.String(200, "") +} diff --git a/internal/web/server.go b/internal/web/server.go index a41f075..91488bc 100644 --- a/internal/web/server.go +++ b/internal/web/server.go @@ -251,6 +251,7 @@ func NewServer(isDev bool, sessionsPath string) *Server { g1.GET("/preview", preview, logged) g1.GET("/healthcheck", healthcheck) + g1.GET("/metrics", metrics) g1.GET("/register", register) g1.POST("/register", processRegister)