sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Android SentryOkHttpInterceptor provide mechanism to sanitize logged URL

Open alexmetcalfe opened this issue 5 years ago • 3 comments

It seems that using the SentryOkHttpInterceptor out of the box all URLs would be logged and visible in Sentry.

It would be preferable if we could provide a regex or some other mechanism to allow us to sanitize the URL so that we can obscure any customer sensitive information (user generated content)

alexmetcalfe avatar Mar 29 '21 22:03 alexmetcalfe

@alexmetcalfe that's a fair use case, thanks for reporting, I'll discuss this internally.

marandaneto avatar Mar 30 '21 07:03 marandaneto

Hey @maciejwalkowiak I noticed that the SentryOkHttpInterceptor will still log the full URL as a breadcrumb. Would it be possible to allow this to be configurable as well?

alexmetcalfe avatar Jun 07 '21 21:06 alexmetcalfe

@alexmetcalfe for that you can use the https://docs.sentry.io/platforms/android/configuration/options/#before-breadcrumb callback.

marandaneto avatar Jun 08 '21 06:06 marandaneto