Main features
- Automatic capture from Phoenix controllers, LiveViews and Oban jobs
- Plug integration for apps without Phoenix
- Errors stored in PostgreSQL, MySQL/MariaDB or SQLite through Ecto
- Phoenix LiveView dashboard to browse and resolve errors
- Custom context per process, such as user IDs
- Context filtering to strip sensitive data
- Ignore rules and muting of noisy errors
- Pruning of old resolved errors
- Telemetry events for custom notifications
- One-command installer with Igniter
What ErrorTracker does
ErrorTracker is an Elixir library that adds error tracking to an application from the inside. Once installed, it captures exceptions raised in Phoenix controllers, Phoenix LiveViews and Oban background jobs, stores them in a relational database through Ecto, and offers a web dashboard where you can find, inspect and resolve them. The project describes it as the Elixir-native error tracker that runs as part of your application, with the stated goal of keeping error data on your own systems.
Apps that use Plug without Phoenix add a one-line integration to their router, and the same integration catches the rare errors raised in a Phoenix endpoint before routing. Anything else can be reported by hand with ErrorTracker.report/2. The otp_app setting tells ErrorTracker which stack frames belong to your code, so the dashboard can separate them from frames in dependencies.
Context, filtering and noise
ErrorTracker.set_context/1 attaches information such as the current user ID to every error raised in that process, on top of the context the built-in integrations add. A filter behaviour lets you sanitize or remove fields before they are saved, which is the place to strip personal or secret data.
Two mechanisms deal with noisy errors. An ignorer module can drop errors that match your rules, so expected failures are never stored. Muting keeps recording an error and shows it in the dashboard but flags new occurrences as muted, so your notification code can skip them. Errors are kept indefinitely unless you enable the pruner plugin, which removes resolved errors after an interval you choose.
Notifications
ErrorTracker does not send notifications. Its authors keep it focused on tracking and instead emit Telemetry events that you can attach handlers to, for example to post to a chat channel or open a ticket in an issue tracker. This is flexible, but it means alerting is code you write and maintain.
Installing ErrorTracker
The quickest route is the Igniter installer (mix igniter.install error_tracker), which adds the dependency, configures it with the app’s Ecto repo and Phoenix router, and creates the migration. Manually, you add the Hex package, set the repo and otp_app options, generate a migration that calls ErrorTracker.Migration.up/1 and run it. The only stated requirement is a relational database set up with Ecto: PostgreSQL, MySQL/MariaDB or SQLite3. Errors can go to the app’s main repo or to a separate one. The package requires Elixir 1.15 or later and is still below version 1.0.
Hosted version
There is none; it is a library that runs inside your application.
Limitations
ErrorTracker works only for Elixir applications, so browser JavaScript errors and other services need a different tool. There are no built-in notifications, no issue tracker integration, no release tracking and no performance data.
Who it suits
ErrorTracker fits Phoenix and Oban applications whose teams want to see production errors without sending data to an external service or running another server. For a standalone server that accepts errors from many languages, see Rustrak, and read the error tracking guide for the trade-offs.
Technical details
Self-hosting needs
- PostgreSQL
- MySQL or SQLite
Built with
- Elixir
- Phoenix LiveView
- Ecto
GitHub topics
- elixir
- elixir-phoenix
- error-handling
- error-monitoring
- error-reporting
- oban
- phoenix-framework
- phoenix-liveview
Reviewed by the OpenSourcePicks editors from the project's repository and documentation. Something out of date? Tell us.