Enable APM for 30% of requests, add cleanup cron, rename admin URL, and send user ID - #600
Open
cycomachead wants to merge 1 commit into
Open
cycomachead wants to merge 1 commit into
cycomachead wants to merge 1 commit into
Conversation
- Mount Faultline dashboard at /admin/faultline - Enable APM at 30% sample rate with 30-day retention - Add FaultlineCleanupJob for nightly APM and error data cleanup - Attach Canvas user ID from session context to error occurrences - Add deduplication hook to prevent double-reporting of request errors - Ignore health check endpoint and dashboard routes in APM/error tracking https://www.superconductor.com/tickets/nFgQfHNQTKkj/implementations/KnNWkdJ8GtQN?message_id=JrGG8cF7qBjw#message_JrGG8cF7qBjw Co-authored-by: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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
Configures Faultline per the ticket: renames the dashboard URL, enables sampled APM, adds cleanup for retained data, and ensures a basic user ID is sent with every error.
/admin/faultline(was/admin/errors); ignore lists and route helpers updated accordingly./status/health_check) and the dashboard itself.FaultlineCleanupJob(renamed from an APM-only job): Faultline recordsretention_days/apm_retention_daysbut never enforces them itself. This job now nightly:apm_retention_days.retention_days, recomputes theoccurrences_countcounter cache on affected groups, and removes groups left empty — except groups markedignored, so a recurrence doesn't silently open a fresh alerting group.config/application.rb, keyfaultline_cleanup) nightly at 3:30 AM Pacific.custom_contextthat attaches the Canvas uid from the session to every occurrence, in addition to Faultline's existingcurrent_usertracking, so a user is identifiable even when no controller instance is available.application.action_dispatch, no user/URL context). Added abefore_trackhook to drop that duplicate report. Job errors and explicitRails.errorcalls are unaffected.Testing
spec/config/faultline_spec.rb: pins mount path, ignore lists, custom context, dedupe hook, APM settings and retention values.spec/config/good_job_cron_spec.rb: verifies thefaultline_cleanupcron schedule.spec/jobs/faultline_cleanup_job_spec.rb: covers stale vs. fresh traces/profiles, occurrence + context deletion, counter cache recompute, empty-group removal, the ignored-group exception, andretention_days: nil(keep forever).spec/requests/faultline_user_identification_spec.rb: signs in through the real OmniAuth flow, forces a controller exception, and asserts exactly one occurrence is recorded with the correct user ID, email, and Canvas uid — plus the anonymous case./admin/faultlineURL (401 for anonymous, both error and performance pages render for admins).Documentation
Updated
docs/developers.md: addedfaultline_cleanupto the cron table and documented what the job enforces and why (Faultline stores retention settings but doesn't act on them).Checklist
Superconductor Ticket Implementation | App Preview | Guided Review