Hiding absolute paths in Sentry

#1

Hello! I’ve set up Sentry with my Expo project according to the documentation here: https://docs.expo.io/versions/latest/guides/using-sentry.html. When logging errors, I currently see an entire absolute path in the transaction tag / stacktrace which includes the full name of my local directory on my machine (something like Users/MyFolder/…/file.js), making the interface extremely cluttered. I want to only show a shortened / relative path like ~/app/…/file.js. How do I go about doing this?

0 Likes

#2

Hey @rino133,

I’m not sure. Try checking https://docs.sentry.io/clients/react-native/ or https://github.com/getsentry/react-native-sentry

0 Likes

#3

Thanks – I think more generally the question is how to change the path shown in a stack trace using expo to be a relative vs. absolute path? Do you have any ideas here?

0 Likes

#4

this is unrelated to expo, it’s a sentry concern

0 Likes

#5

@notbrent thanks for the reply. independent of sentry though, is there a way to hide the working directory information from the error stack trace?

0 Likes

#6

hide it from where? the red box? exp / xde logs?

0 Likes

#7

Yes, the red box. I am probably not describing the issue well, but more specifically I think it would entail skipping prefixes on filenames in the source maps.

0 Likes

#8

this is the source of the redbox on ios: https://github.com/facebook/react-native/blob/master/React/Modules/RCTRedBox.m

0 Likes

closed #9

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

0 Likes