composer: glitchtip integration

This commit is contained in:
Diaa Sami 2024-01-18 20:22:36 +01:00 committed by Ondřej Budai
parent 95b4979d88
commit c9c51613a4
63 changed files with 8857 additions and 220 deletions

View file

@ -12,6 +12,8 @@ import (
"github.com/getkin/kin-openapi/openapi3"
"github.com/getkin/kin-openapi/routers"
legacyrouter "github.com/getkin/kin-openapi/routers/legacy"
"github.com/getsentry/sentry-go"
sentryecho "github.com/getsentry/sentry-go/echo"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
@ -87,6 +89,12 @@ func (s *Server) Handler(path string) http.Handler {
e.Use(middleware.Recover())
e.Logger = common.Logger()
if sentry.CurrentHub().Client() == nil {
logrus.Warn("Sentry/Glitchtip not initialized, echo middleware was not enabled")
} else {
e.Use(sentryecho.New(sentryecho.Options{}))
}
handler := apiHandlers{
server: s,
}