Skip to content

Commit

Permalink
fix(otel): fetch the trace and span ids in user context instead of co…
Browse files Browse the repository at this point in the history
…ntext
  • Loading branch information
samber committed Aug 17, 2024
1 parent 8691155 commit e76a0d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func NewWithConfig(logger *slog.Logger, config Config) fiber.Handler {
}

// otel
baseAttributes = append(baseAttributes, extractTraceSpanID(c.Context(), config.WithTraceID, config.WithSpanID)...)
baseAttributes = append(baseAttributes, extractTraceSpanID(c.UserContext(), config.WithTraceID, config.WithSpanID)...)

// request body
requestAttributes = append(requestAttributes, slog.Int("length", len((c.Body()))))
Expand Down

0 comments on commit e76a0d1

Please sign in to comment.