Faultline Error Tracking#479
Merged
cycomachead merged 7 commits intoJul 4, 2026
Merged
Conversation
Mount faultline at /admin/errors, gated to admins via User.find_by(canvas_uid: session[:user_id])&.admin?. Migrations carry overrides for strong_migrations (safety_assured on the raw tsvector execute and the json column) and guard the redundant change_sanitized_message_to_text migration, which is a no-op on fresh PostgreSQL installs and otherwise fails against the generated column. Depends on Rails >= 8.0 (faultline gemspec constraint). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…start/2' into cycomachead/166-faultline-compatibility-check/1
Resolve faultline directly from git (upstream gemspec's rails >= 8.0 is now satisfied by Rails 8.1) and regenerate schema.rb in the 8.1 format. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Vendor faultline gem to override Rails 8.0 gemspec constraint - Mount dashboard at `/admin/errors` with admin-only access gate - Configure automatic user identification via `current_user` - Add and patch migrations to satisfy `strong_migrations` and PostgreSQL - Disable MCP and APM features by default This allows adopting self-hosted error tracking without requiring an immediate upgrade to Rails 8.0. Co-authored-by: Claude Code <noreply@anthropic.com>
20 tasks
…line-compatibility-check/1 # Conflicts: # db/schema.rb
Enables `config.register_error_subscriber` to automatically capture exceptions reported via the Rails 7.2+ error reporting API, including background jobs and handled errors. Co-authored-by: Claude Code <noreply@anthropic.com>
- Add Rails.error.report to rescue blocks across controllers and models to instrument Tier 1 audit results without vendor lock-in. - Guard current_user in lograge initializer to prevent NoMethodError when accessing mounted engine controllers like Faultline. Co-authored-by: Claude Code <noreply@anthropic.com>
Contributor
Author
|
This is working on staging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
General Info
Changes
Installs Faultline for self-hosted error tracking. This PR also includes the Rails 8.1 upgrade (merged from
cycomachead/137-rails-8-upgrade-start/2), which conveniently satisfies Faultline'srails >= 8.0gemspec constraint — eliminating the need for vendoring or a fork.Faultline setup
gem 'faultline'pointing at the upstream git repo (no vendoring needed on 8.1)/admin/errorsconfig.authenticate_with— resolves the current user fromsession[:user_id](matchingApplicationController#current_user) and requiresadmin?user_method: :current_userso request errors are automatically associated with the logged-in userMigration overrides
Three of Faultline's generated migrations required patches to work cleanly with
strong_migrationsand PostgreSQL:create_faultline_error_groupsstrong_migrationscan't inspect rawexecutefor thetsvectorgenerated columnsafety_assuredadd_spans_to_faultline_request_tracesstrong_migrationsflags:jsoncolumn (prefersjsonb)safety_assured, keeping Faultline's schemachange_sanitized_message_to_textsanitized_messageis already:textand used by a generated column — Postgres refuses to alter itRails 8.1 changes (from merged branch)
config.load_defaultsbumped to8.1params.require(...).permit(...)→params.expect(...)in several controllersApplicationMailerbase class extracted;EmailServiceupdated to useTemplatedMailerpublic/400.htmladded (Rails 8.1 default)have_http_status(:unprocessable_entity)→have_http_status(:unprocessable_content), error message string updated forparams.expectNew transitive gems
0.22.0— https://github.com/modelcontextprotocol/ruby-sdk (dormant; only active if MCP is enabled)2.5.0— https://github.com/davishmcclurg/json_schemer1.3.7— https://github.com/tenderlove/hana0.2.3— https://github.com/mmriis/simpleidnTesting
strong_migrationserrorsGET /admin/errors(unauthenticated or non-admin) returns 401 UnauthorizedFaultline.track(exception)creates error groups and occurrences visible on the dashboardcurrent_userDocumentation
No external documentation required. The generated initializer at
config/initializers/faultline.rbis extensively commented with configuration options for notifications, GitHub integration, APM, and callbacks.Checklist
Superconductor Ticket Implementation | App Preview | Guided Review