elixir-error-tracker / error-tracker

🐛 An Elixir-based built-in error reporting and tracking solution
https://hex.pm/packages/error_tracker
Apache License 2.0
414 stars 18 forks source link

Proper configuration for an umbrella appliction? #103

Closed brainlid closed 3 weeks ago

brainlid commented 1 month ago

While looking at the Getting Started guide, it says:

ErrorTracker needs a few configuration options to work. This configuration should be added to your config/config.exs file:

config :error_tracker,
repo: MyApp.Repo,
otp_app: :my_app,
enabled: true

I have a non-web OTP application called "core" and a separate web application in an umbrella configuration. I expect errors are possible from both applications and would like them to be tracked properly.

Is there a recommended configuration for this situation where I effectively have 2 different otp_apps that are part of the same code base?

EDIT: If I could make a request, then I'd like it to be otp_app: [:my_core, :my_web] or, otp_apps: [:one, :two] (where otp_apps is plural.

odarriba commented 3 weeks ago

It is expected to use the same as you put in :ecto config, the main otp app of your system.

We use that internally to try to detect the first line in your code that is generating the issue (if not found, we get the first line, which is where the error raised). Aside from that, we also use it to make the checkbox of "show only app frames" of the UI to work.

Right now the best approach is to put the name of the otp_app where most of your business logic is, as adding support to multiple otp_app values at once is not in the roadmap.

Hope it helps!