getsentry / sentry-elixir

The official Elixir SDK for Sentry (sentry.io)
https://sentry.io
MIT License
626 stars 185 forks source link

Better `:in_app_module_allow_list` default #800

Open sl0thentr0py opened 1 month ago

sl0thentr0py commented 1 month ago

Currently in_app_module_allow_list defaults to an empty list, so most users don't get good in-app frames marked. Ruby for instance defaults to a combination of project root + known common directory names https://github.com/getsentry/sentry-ruby/blob/c3bcfa0401856d9ee7616c95ab9dfe988a89da30/sentry-ruby/lib/sentry/backtrace.rb#L91-L93

whatyouhide commented 1 month ago

@savhappy we could use :application.get_key(app, :modules) to get all the app modules.

Basically, we could do this if :in_app_module_allow_list is not set:

  1. Check if we're in an umbrella project (Mix.Project.umbrella?/1).
  2. If yes, then we get all the apps from the umbrella and do what's described below, otherwise just do it for the root app.
  3. Get the app name for the current Mix project.
  4. Get the modules with :application.get_key(app, :modules).

This might not be trivial work, want me to give it a try first?

savhappy commented 1 month ago

@whatyouhide yep! Go for it! If you need me to take some of the work load let me know

sl0thentr0py commented 1 month ago

yep sounds good to me, thx both!