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.

ErrorTrack 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.

Suggested titles
  1. ErrorTrack: Self-hosted Sentry-style error tracking for Rails, in your own database
  2. I built a Rails gem that logs exceptions to your DB and shows them at /errors — no Sentry bill
  3. error_track: Drop-in Rails error dashboard with zero external services
Short blurb (RubyFlow / social)

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

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