mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-05-17 02:46:33 +02:00
Add API metric collection
This commit is contained in:
parent
ff7339d88f
commit
801cf8d84c
3 changed files with 10 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
chiprometheus "github.com/766b/chi-prometheus"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -12,6 +13,9 @@ import (
|
|||
func SetupAPI() chi.Router {
|
||||
router := chi.NewRouter()
|
||||
|
||||
m := chiprometheus.NewMiddleware("api")
|
||||
router.Use(m)
|
||||
|
||||
router.NotFound(notFoundHandler)
|
||||
router.MethodNotAllowed(methodNotAllowedHandler)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue