The best way to scrub params in url path #15633
Gordienko-RU
started this conversation in
General
Replies: 1 comment
-
@Gordienko-RU that seems to be the most foolproof way of accomplishing this. The SDK has no way of knowing your application's routing structure otherwise. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
We have React application(with react-router and react-query) which consists of several microfrontends and does a lot of requests to different services.
The requirement is - error report should contain no client sensitive information and a lot of requests which app currently does contain that info in url path params.
For examle
/users/12134/orders/2345
- should be transformed to smth like -/users/:userId/orders/:orderId
.Currently have two ideas:
Sort of:
const apiMasks = [
/users/:userId/orders/:orderId
]
Having that info, I can find a match between url string and such pattern and understand where params are placed, to finaly make some nice substitution like react-router actually does for transaction value.
Then I define beforeSendTransaction / beforeSend / beforeBreadcrumb / beforeSendSpan - to find all possible url injections within event data and update them.
This way is much simpler, but is based on assumptions and output urls are not so nice.
Tbh I don't think there are some nice solutions here, cause we need to know information about api to make some nice polishing from FE side, but maybe there is already libs or approaches implemented by community?
Beta Was this translation helpful? Give feedback.
All reactions