error_track: Drop-in Rails error dashboard with zero external services
Sentry and Honeybadger are great — until you don’t want another vendor, another bill, or exception data leaving your infrastructure.
ErrorTrack is a small Rails engine that:
- Captures unhandled exceptions (Rack middleware) and
Rails.errorreports - Groups repeats into issues (count, first/last seen)
- Stores backtrace + request context in your DB
- Serves a dashboard at
/errors— vanilla JS, no Hotwire/React/npm/CDN
Works the same in full-stack Rails and rails new --api apps.
/errors still works on the Rails host
Ops complexity
One gem + one migration
Install
Add to your Gemfile:
ruby
gem "error_track", "~> 0.1.0"
Then run:
bash
bundle install
rails generate error_track:install
rails db:migrate
That adds the migration, initializer, and mounts the engine at /errors. Open /errors in your app.
ruby
begin
risky_call
rescue => e
ErrorTrack.notify(e, context: { user_id: current_user&.id, order_id: order.id })
raise
end
/errors has no auth by default. Lock it down:
ruby
# config/initializers/error_track.rb
Rails.application.config.to_prepare do
ErrorTrack::ErrorsController.class_eval do
before_action :authenticate_admin!
end
end
Or with Devise:
ruby
authenticate :user, ->(u) { u.admin? } do
mount ErrorTrack::Engine => "/errors"
end
HTTP Basic works well for API-only apps:
ruby
Rails.application.config.to_prepare do
ErrorTrack::ErrorsController.class_eval do
http_basic_authenticate_with(
name: Rails.application.credentials.dig(:error_track, :user),
password: Rails.application.credentials.dig(:error_track, :password)
)
end
end
Fingerprint = exception class + first in-app backtrace line (line numbers normalized). Same bug 500 times → one row with count 500.
Links- RubyGems: https://rubygems.org/gems/error_track
- GitHub: https://github.com/adityapandit17/error_track
- Requires: Ruby ≥ 3.0, Rails ≥ 7.0
Feedback, issues, and PRs welcome. If this saves you a Sentry invoice — star the repo and tell me what you’d add next.
Suggested titles- ErrorTrack: Self-hosted Sentry-style error tracking for Rails, in your own database
- I built a Rails gem that logs exceptions to your DB and shows them at
/errors— no Sentry bill - error_track: Drop-in Rails error dashboard with zero external services
ErrorTrack is a mountable Rails engine that captures exceptions like Sentry/Honeybadger — but stores them in your app’s database and shows a dashboard at /errors. No third-party service, API keys, or extra infra. Works in full-stack and API-only Rails apps.
ruby
gem "error_track"
bash
bundle install && rails g error_track:install && rails db:migrate
Post a comment