feat: add prometheus metrics
This commit is contained in:
parent
b4c331daa0
commit
5c8c6eed63
7 changed files with 110 additions and 9 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"codeberg.org/u1f320/pronouns.cc/backend/server"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/render"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
|
@ -23,6 +24,8 @@ func Mount(srv *server.Server, r chi.Router) {
|
|||
r.Patch("/reports/{id}", server.WrapHandler(s.resolveReport))
|
||||
})
|
||||
|
||||
r.With(MustAdmin).Handle("/metrics", promhttp.Handler())
|
||||
|
||||
r.With(server.MustAuth).Post("/users/{id}/reports", server.WrapHandler(s.createUserReport))
|
||||
r.With(server.MustAuth).Post("/members/{id}/reports", server.WrapHandler(s.createMemberReport))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue