ErrorTracker

Adds ErrorTracker, an Elixir-based built-in error tracking solution, to your Phoenix application. It stores application errors in your existing database and provides a Phoenix LiveView dashboard for reviewing, resolving, muting, and inspecting occurrences without relying on an external error tracking service.

Key Benefits

  • Built-in error tracking with no external SaaS account or hosted service required
  • Automatic Phoenix and LiveView reporting for exceptions raised in controllers and LiveViews
  • Oban-aware tracking when Oban is installed, with job metadata included in error context
  • Database-backed dashboard for investigating stack traces, occurrences, breadcrumbs, and context
  • Production hygiene through the included pruner plugin for resolved errors

Implementation Details The feature installs the error_tracker dependency, configures it with your application repo and OTP app, adds the database migration required by ErrorTracker.Migration, and mounts the dashboard. When the admin feature is installed, the dashboard is mounted under /admin/errors and linked from the admin developer page. Without the admin feature, the dashboard is added beside the development LiveDashboard route.

Usage Example

try do
perform_risky_operation()
catch
error ->
ErrorTracker.report(error, __STACKTRACE__, %{operation: "risky_operation"})
end

Configuration ErrorTracker is enabled outside the test environment and uses your existing MyApp.Repo for storage. The pruner plugin is enabled with its default settings so resolved errors can be cleaned up over time.