Closed technicalpickles closed 1 year ago
Sure the first sounds really good and a PR would be welcome!
For the second we already have this code: https://github.com/charkost/prosopite/blob/1f53947c5aaaca4e0dd773a91a0b8591fc449cc3/lib/prosopite.rb#L199
We should find why it doesn't work in your case.
Sure the first sounds really good and a PR would be welcome!
🎉 https://github.com/charkost/prosopite/pull/54 🎉
We should find why it doesn't work in your case.
I'm not sure why it didn't, but I couldn't reproduce. I even checked if some of those filenames included Bundle.bundle_path.to_s
and it did.
Separate from that not working, the backtrace cleaner offers additional benefits from checking Bundler.bundled_path
that I mention on the PR:
The default Rails.backtrace_cleaner includes that plus stdlib stuff, and also cleans up files relative to the current directory (ie /Users/technicalpickles/my_app/lib/foo.rb becomes lib/foo.rb). A user can also other filters, which we've done for things like middleware that is included everywhere.
Implemented and released! https://github.com/charkost/prosopite/pull/54 and https://github.com/charkost/prosopite/releases/tag/1.3.0
We're using prosopite, but have found that the stack traces are too long and verbose to actually be useful to help find the place making the query. There's two parts to this:
Rails.root
(shown in README.md)Here's an example:
There's only 4 lines that actually help find and resolve this (the ones in
ourapp
), and the rest our noise.ActiveSupport actually has something just for this kind of thing: ActiveSupport::BacktraceCleaner. Rails sets one up accessible at
Rails.backtrace_cleaner
that can be tuned in an initializer (config/initializers/backtrace_silencers.rb
is generated by default).I'd like to look at using that in prosopite, but wanted to write the idea up first. I think we can just re-use the existing
Rails.backtrace_cleaner
, but there may also be value in having its own, or being able to tweak it separate from Rails.cc @kplawver who was asking about this, and who had the stack trace