internal: remove sentryhttp from main server mux to prevent double traces
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
8e7a456f74
commit
242423cf3c
|
@ -36,7 +36,7 @@ error_reporting:
|
||||||
enabled: false
|
enabled: false
|
||||||
environment: customer
|
environment: customer
|
||||||
send_pii: false
|
send_pii: false
|
||||||
sample_rate: 0.3
|
sample_rate: 0.1
|
||||||
|
|
||||||
# Global email settings
|
# Global email settings
|
||||||
email:
|
email:
|
||||||
|
|
|
@ -95,7 +95,7 @@ def traces_sampler(sampling_context: dict) -> float:
|
||||||
# Ignore all healthcheck routes
|
# Ignore all healthcheck routes
|
||||||
if path.startswith("/-/health") or path.startswith("/-/metrics"):
|
if path.startswith("/-/health") or path.startswith("/-/metrics"):
|
||||||
return 0
|
return 0
|
||||||
return float(CONFIG.y("error_reporting.sample_rate", 0.5))
|
return float(CONFIG.y("error_reporting.sample_rate", 0.1))
|
||||||
|
|
||||||
|
|
||||||
def before_send(event: dict, hint: dict) -> Optional[dict]:
|
def before_send(event: dict, hint: dict) -> Optional[dict]:
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
sentryhttp "github.com/getsentry/sentry-go/http"
|
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/pires/go-proxyproto"
|
"github.com/pires/go-proxyproto"
|
||||||
|
@ -36,7 +35,6 @@ type WebServer struct {
|
||||||
func NewWebServer(g *gounicorn.GoUnicorn) *WebServer {
|
func NewWebServer(g *gounicorn.GoUnicorn) *WebServer {
|
||||||
l := log.WithField("logger", "authentik.router")
|
l := log.WithField("logger", "authentik.router")
|
||||||
mainHandler := mux.NewRouter()
|
mainHandler := mux.NewRouter()
|
||||||
mainHandler.Use(sentryhttp.New(sentryhttp.Options{}).Handle)
|
|
||||||
mainHandler.Use(handlers.ProxyHeaders)
|
mainHandler.Use(handlers.ProxyHeaders)
|
||||||
mainHandler.Use(handlers.CompressHandler)
|
mainHandler.Use(handlers.CompressHandler)
|
||||||
loggingHandler := mainHandler.NewRoute().Subrouter()
|
loggingHandler := mainHandler.NewRoute().Subrouter()
|
||||||
|
|
Reference in New Issue