Skip to content

Commit

Permalink
fix: don't treat missing session as error in tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
alnr committed Feb 7, 2023
1 parent a7f9414 commit 290d28a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion session/manager_http.go
Expand Up @@ -195,7 +195,13 @@ func (s *ManagerHTTP) extractToken(r *http.Request) string {

func (s *ManagerHTTP) FetchFromRequest(ctx context.Context, r *http.Request) (_ *Session, err error) {
ctx, span := s.r.Tracer(ctx).Tracer().Start(ctx, "sessions.ManagerHTTP.FetchFromRequest")
defer otelx.End(span, &err)
defer func() {
if e := new(ErrNoActiveSessionFound); errors.As(err, &e) {
span.End()
} else {
otelx.End(span, &err)
}
}()

token := s.extractToken(r)
if token == "" {
Expand Down

0 comments on commit 290d28a

Please sign in to comment.