RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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.

error_track is a small Rails engine that:

  • Captures unhandled exceptions (Rack middleware) and Rails.error reports
  • 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.

Why it helps Pain What ErrorTrack does Paid error services Free, MIT, self-hosted Data residency / privacy Errors stay in your DB API-only / Next.js backends /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.

Manual reporting

ruby begin risky_call rescue => e ErrorTrack.notify(e, context: { user_id: current_user&.id, order_id: order.id }) raise end

Secure the dashboard

/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

How grouping works

Fingerprint = exception class + first in-app backtrace line (line numbers normalized). Same bug 500 times → one row with count 500.

Links

Feedback, issues, and PRs welcome. If this saves you a Sentry invoice — star the repo and tell me what you’d add next.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in