getsentry / raven-go

Sentry client in Go
https://sentry.io
BSD 3-Clause "New" or "Revised" License
561 stars 148 forks source link

Add file filter that can alter file names used in stack traces #115

Open Schnouki opened 8 years ago

Schnouki commented 8 years ago

This very small patch is something I needed when deploying an app on Heroku.

On Heroku, my app was built in something like /tmp/tmp.FtT7NPkJnn/.go/src/mypackage, but at runtime the app was in /app (with its source files). Because of that, at runtime raven could not access the source files as it was looking in /tmp/tmp.FtT7NPkJnn/....

By adding a FileFilter() functions that checks if the file is available in the working dir, I am now able to have full, readable stack traces on Sentry with proper context. Which is nice 😃