sentry-elixir icon indicating copy to clipboard operation
sentry-elixir copied to clipboard

Better `:in_app_module_allow_list` default

Open sl0thentr0py opened this issue 1 year ago • 3 comments

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

sl0thentr0py avatar Sep 19 '24 14:09 sl0thentr0py

@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?

whatyouhide avatar Sep 20 '24 06:09 whatyouhide

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

savhappy avatar Sep 20 '24 08:09 savhappy

yep sounds good to me, thx both!

sl0thentr0py avatar Sep 20 '24 11:09 sl0thentr0py

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

@whatyouhide could you tell me what would be a good way of resolving what app is? It seems to me that we should fill in the in_app_module_allow_list setting when Sentry app starts via put_config but I am not sure how to resolve app there.

solnic avatar Jan 27 '25 15:01 solnic

Get the app name for the current Mix project.

This, at compile time, or we just make it explicit

whatyouhide avatar Jan 28 '25 13:01 whatyouhide