Skip to content

Integrate prefixes for relative filenames stripping #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kamilogorek opened this issue Sep 12, 2017 · 2 comments
Closed

Integrate prefixes for relative filenames stripping #1036

kamilogorek opened this issue Sep 12, 2017 · 2 comments

Comments

@kamilogorek
Copy link
Contributor

Reference: https://docs.sentry.io/clients/php/config/
Previous discussion: #670

@mathagician
Copy link

@kamilogorek I would like to work on this issue. Since I am new to this, I would seek your help and guidance for this. Please help how to get started.

@kamilogorek
Copy link
Contributor Author

kamilogorek commented Oct 12, 2017

Hey @mathagician!

Things that need to be done:

  • add profixes code to the lib
  • add tests covering this change
  • update docs

Tests and docs can be based on existing options, which should be (hopefully) readable enough to be reused.

When it comes to code, we need to:

  • pass a prefixes option, which will be an array of strings – see prefixes section here https://docs.sentry.io/clients/php/config/
  • store it internally as any other option eg. this._globalOptions.prefixes
  • write a normalizeUrl, stripPrefixes or something like this function, that'll take a string, check if there are any prefixes, if so, iterate over them and strip anything that has been matched
  • apply this function to culprit and all frames from the data payload

Here is a perfect examples where this function should be applied: #634 (comment)

And here's how it's done on for react-native https://github.com/getsentry/react-native-sentry/blob/8b6bea853343d9dfde24735ed55fbf57d5ca2e94/lib/raven-plugin.js#L243-L264

Let me know if you need any more help with it :)

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants