mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
fix: correct tracing in access interceptor (#5766)
This commit is contained in:
parent
39bdef35e7
commit
40bf7e49cc
@ -43,12 +43,10 @@ func (a *AccessInterceptor) Handle(next http.Handler) http.Handler {
|
|||||||
return next
|
return next
|
||||||
}
|
}
|
||||||
return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
|
return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
|
||||||
|
|
||||||
ctx := request.Context()
|
ctx := request.Context()
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
tracingCtx, span := tracing.NewServerInterceptorSpan(ctx)
|
tracingCtx, checkSpan := tracing.NewNamedSpan(ctx, "checkAccess")
|
||||||
defer func() { span.EndWithError(err) }()
|
|
||||||
|
|
||||||
wrappedWriter := &statusRecorder{ResponseWriter: writer, status: 0}
|
wrappedWriter := &statusRecorder{ResponseWriter: writer, status: 0}
|
||||||
|
|
||||||
@ -63,8 +61,13 @@ func (a *AccessInterceptor) Handle(next http.Handler) http.Handler {
|
|||||||
wrappedWriter.ignoreWrites = true
|
wrappedWriter.ignoreWrites = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkSpan.End()
|
||||||
|
|
||||||
next.ServeHTTP(wrappedWriter, request)
|
next.ServeHTTP(wrappedWriter, request)
|
||||||
|
|
||||||
|
tracingCtx, writeSpan := tracing.NewNamedSpan(tracingCtx, "writeAccess")
|
||||||
|
defer writeSpan.End()
|
||||||
|
|
||||||
requestURL := request.RequestURI
|
requestURL := request.RequestURI
|
||||||
unescapedURL, err := url.QueryUnescape(requestURL)
|
unescapedURL, err := url.QueryUnescape(requestURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user