Skip to content

Commit

Permalink
fix: adds tracing to cookie_session and bearer_token authenticators (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
achedeuzot authored Sep 12, 2022
1 parent 686efbe commit 6504c0a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pipeline/authn/authenticator_cookie_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"net/http"
"net/url"

"github.com/ory/oathkeeper/x"

"github.com/pkg/errors"
"github.com/tidwall/gjson"

Expand Down Expand Up @@ -170,7 +172,13 @@ func forwardRequestToSessionStore(r *http.Request, cf AuthenticatorForwardConfig
return nil, err
}

// add tracing
closeSpan := x.TraceRequest(r.Context(), &req)

res, err := http.DefaultClient.Do(req.WithContext(r.Context()))

// close the span so it represents just the http request
closeSpan()
if err != nil {
return nil, helper.ErrForbidden.WithReason(err.Error()).WithTrace(err)
}
Expand Down

0 comments on commit 6504c0a

Please sign in to comment.