feat: add sentry spans to evaluate proxy performances
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"forge.cadoles.com/Cadoles/go-proxy"
|
||||
"forge.cadoles.com/Cadoles/go-proxy/wildcard"
|
||||
"forge.cadoles.com/cadoles/bouncer/internal/cache"
|
||||
bouncersentry "forge.cadoles.com/cadoles/bouncer/internal/sentry"
|
||||
"forge.cadoles.com/cadoles/bouncer/internal/store"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@ -257,6 +258,7 @@ func (d *Director) Middleware() proxy.Middleware {
|
||||
}
|
||||
|
||||
handler := createMiddlewareChain(next, httpMiddlewares)
|
||||
handler = bouncersentry.SpanHandler(handler, "director.proxy")
|
||||
|
||||
handler.ServeHTTP(w, r)
|
||||
}
|
||||
|
@ -30,6 +30,8 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"gitlab.com/wpetit/goweb/logger"
|
||||
|
||||
bouncersentry "forge.cadoles.com/cadoles/bouncer/internal/sentry"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@ -189,7 +191,7 @@ func (s *Server) run(parentCtx context.Context, addrs chan net.Addr, errs chan e
|
||||
proxy.WithDefaultHandler(http.HandlerFunc(s.handleDefault)),
|
||||
)
|
||||
|
||||
r.Handle("/*", handler)
|
||||
r.Handle("/*", bouncersentry.SpanHandler(handler, "http.proxy"))
|
||||
})
|
||||
|
||||
if err := http.Serve(listener, router); err != nil && !errors.Is(err, net.ErrClosed) {
|
||||
|
Reference in New Issue
Block a user