mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-15 01:02:41 +02:00
add chi metrics middleware.
This commit is contained in:
parent
5b7784f2a4
commit
0952be6a94
5 changed files with 162 additions and 0 deletions
|
@ -5,6 +5,8 @@ import (
|
|||
"errors"
|
||||
"net/http"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
|
||||
"gitlab.com/demodesk/neko/server/internal/api/members"
|
||||
"gitlab.com/demodesk/neko/server/internal/api/room"
|
||||
"gitlab.com/demodesk/neko/server/pkg/auth"
|
||||
|
@ -62,6 +64,11 @@ func (api *ApiManagerCtx) Route(r types.Router) {
|
|||
_, err := w.Write([]byte("true"))
|
||||
return err
|
||||
})
|
||||
|
||||
r.Get("/metrics", func(w http.ResponseWriter, r *http.Request) error {
|
||||
promhttp.Handler().ServeHTTP(w, r)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func (api *ApiManagerCtx) Authenticate(w http.ResponseWriter, r *http.Request) (context.Context, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue