Module: RailsErrorDashboard
- Defined in:
- lib/rails_error_dashboard/error_reporter.rb,
lib/rails_error_dashboard.rb,
lib/rails_error_dashboard/engine.rb,
lib/rails_error_dashboard/logger.rb,
lib/rails_error_dashboard/plugin.rb,
lib/rails_error_dashboard/version.rb,
lib/rails_error_dashboard/configuration.rb,
lib/rails_error_dashboard/plugin_registry.rb,
app/models/rails_error_dashboard/error_log.rb,
app/models/rails_error_dashboard/application.rb,
lib/rails_error_dashboard/commands/log_error.rb,
lib/rails_error_dashboard/queries/mttr_stats.rb,
lib/rails_error_dashboard/configuration_error.rb,
lib/rails_error_dashboard/queries/errors_list.rb,
app/jobs/rails_error_dashboard/application_job.rb,
app/models/rails_error_dashboard/error_comment.rb,
app/models/rails_error_dashboard/error_baseline.rb,
lib/rails_error_dashboard/commands/assign_error.rb,
lib/rails_error_dashboard/commands/snooze_error.rb,
lib/rails_error_dashboard/manual_error_reporter.rb,
app/models/rails_error_dashboard/cascade_pattern.rb,
lib/rails_error_dashboard/commands/resolve_error.rb,
lib/rails_error_dashboard/plugins/metrics_plugin.rb,
lib/rails_error_dashboard/queries/baseline_stats.rb,
lib/rails_error_dashboard/queries/error_cascades.rb,
lib/rails_error_dashboard/queries/filter_options.rb,
lib/rails_error_dashboard/queries/similar_errors.rb,
app/helpers/rails_error_dashboard/overview_helper.rb,
app/jobs/rails_error_dashboard/baseline_alert_job.rb,
app/models/rails_error_dashboard/error_occurrence.rb,
lib/rails_error_dashboard/commands/unassign_error.rb,
lib/rails_error_dashboard/commands/unsnooze_error.rb,
lib/rails_error_dashboard/middleware/rate_limiter.rb,
lib/rails_error_dashboard/queries/analytics_stats.rb,
lib/rails_error_dashboard/queries/critical_alerts.rb,
lib/rails_error_dashboard/queries/dashboard_stats.rb,
lib/rails_error_dashboard/services/cache_analyzer.rb,
lib/rails_error_dashboard/services/curl_generator.rb,
app/helpers/rails_error_dashboard/backtrace_helper.rb,
app/models/rails_error_dashboard/error_logs_record.rb,
lib/rails_error_dashboard/commands/upsert_baseline.rb,
lib/rails_error_dashboard/middleware/error_catcher.rb,
lib/rails_error_dashboard/plugins/audit_log_plugin.rb,
lib/rails_error_dashboard/queries/recurring_issues.rb,
app/helpers/rails_error_dashboard/user_agent_helper.rb,
lib/rails_error_dashboard/queries/error_correlation.rb,
lib/rails_error_dashboard/services/backtrace_parser.rb,
lib/rails_error_dashboard/services/cascade_detector.rb,
lib/rails_error_dashboard/services/error_normalizer.rb,
lib/rails_error_dashboard/services/exception_filter.rb,
lib/rails_error_dashboard/services/git_blame_reader.rb,
lib/rails_error_dashboard/services/pattern_detector.rb,
app/helpers/rails_error_dashboard/application_helper.rb,
app/jobs/rails_error_dashboard/retention_cleanup_job.rb,
app/mailers/rails_error_dashboard/application_mailer.rb,
lib/rails_error_dashboard/commands/add_error_comment.rb,
lib/rails_error_dashboard/queries/n_plus_one_summary.rb,
lib/rails_error_dashboard/services/error_broadcaster.rb,
lib/rails_error_dashboard/services/platform_detector.rb,
lib/rails_error_dashboard/helpers/user_model_detector.rb,
lib/rails_error_dashboard/queries/co_occurring_errors.rb,
lib/rails_error_dashboard/queries/platform_comparison.rb,
lib/rails_error_dashboard/services/source_code_reader.rb,
lib/rails_error_dashboard/value_objects/error_context.rb,
app/jobs/rails_error_dashboard/async_error_logging_job.rb,
lib/rails_error_dashboard/commands/batch_delete_errors.rb,
lib/rails_error_dashboard/commands/update_error_status.rb,
lib/rails_error_dashboard/queries/cache_health_summary.rb,
lib/rails_error_dashboard/queries/deprecation_warnings.rb,
lib/rails_error_dashboard/services/backtrace_processor.rb,
lib/rails_error_dashboard/services/baseline_calculator.rb,
lib/rails_error_dashboard/services/n_plus_one_detector.rb,
lib/rails_error_dashboard/services/pearson_correlation.rb,
lib/rails_error_dashboard/services/severity_classifier.rb,
app/controllers/rails_error_dashboard/errors_controller.rb,
lib/rails_error_dashboard/commands/batch_resolve_errors.rb,
lib/rails_error_dashboard/services/breadcrumb_collector.rb,
lib/rails_error_dashboard/services/environment_snapshot.rb,
lib/rails_error_dashboard/services/error_hash_generator.rb,
lib/rails_error_dashboard/services/notification_helpers.rb,
lib/rails_error_dashboard/commands/update_error_priority.rb,
lib/rails_error_dashboard/services/cause_chain_extractor.rb,
lib/rails_error_dashboard/services/github_link_generator.rb,
lib/rails_error_dashboard/services/sensitive_data_filter.rb,
lib/rails_error_dashboard/services/similarity_calculator.rb,
lib/rails_error_dashboard/services/slack_payload_builder.rb,
lib/rails_error_dashboard/commands/upsert_cascade_pattern.rb,
lib/rails_error_dashboard/plugins/jira_integration_plugin.rb,
lib/rails_error_dashboard/services/notification_throttler.rb,
lib/rails_error_dashboard/services/statistical_classifier.rb,
lib/rails_error_dashboard/services/system_health_snapshot.rb,
lib/rails_error_dashboard/commands/find_or_increment_error.rb,
lib/rails_error_dashboard/services/analytics_cache_manager.rb,
lib/rails_error_dashboard/services/discord_payload_builder.rb,
lib/rails_error_dashboard/services/webhook_payload_builder.rb,
app/jobs/rails_error_dashboard/email_error_notification_job.rb,
app/jobs/rails_error_dashboard/slack_error_notification_job.rb,
app/mailers/rails_error_dashboard/error_notification_mailer.rb,
lib/rails_error_dashboard/services/baseline_alert_throttler.rb,
lib/rails_error_dashboard/subscribers/breadcrumb_subscriber.rb,
app/controllers/rails_error_dashboard/application_controller.rb,
lib/rails_error_dashboard/services/pagerduty_payload_builder.rb,
lib/rails_error_dashboard/services/priority_score_calculator.rb,
app/jobs/rails_error_dashboard/discord_error_notification_job.rb,
app/jobs/rails_error_dashboard/webhook_error_notification_job.rb,
lib/rails_error_dashboard/commands/find_or_create_application.rb,
lib/generators/rails_error_dashboard/install/install_generator.rb,
lib/rails_error_dashboard/commands/increment_cascade_detection.rb,
app/jobs/rails_error_dashboard/pagerduty_error_notification_job.rb,
lib/rails_error_dashboard/commands/calculate_cascade_probability.rb,
lib/rails_error_dashboard/services/error_notification_dispatcher.rb,
lib/rails_error_dashboard/services/baseline_alert_payload_builder.rb,
lib/generators/rails_error_dashboard/uninstall/uninstall_generator.rb,
lib/generators/rails_error_dashboard/solid_queue/solid_queue_generator.rb
Overview
Rack Middleware: Final safety net for uncaught errors This catches errors that somehow escape controller error handling Positioned at the Rack layer (outermost layer of Rails)
Middleware stack order (outer to inner):
-
ErrorCatcher (this file) ← Catches everything
-
ActionDispatch middleware
-
Rails routing
-
Controllers (with ErrorHandler concern)
This ensures NO error goes unreported
Defined Under Namespace
Modules: ApplicationHelper, BacktraceHelper, Commands, Generators, Helpers, Logger, Middleware, OverviewHelper, Plugins, Queries, Services, Subscribers, UserAgentHelper, ValueObjects Classes: Application, ApplicationController, ApplicationJob, ApplicationMailer, AsyncErrorLoggingJob, BaselineAlertJob, CascadePattern, Configuration, ConfigurationError, DiscordErrorNotificationJob, EmailErrorNotificationJob, Engine, ErrorBaseline, ErrorComment, ErrorLog, ErrorLogsRecord, ErrorNotificationMailer, ErrorOccurrence, ErrorReporter, ErrorsController, ManualErrorReporter, PagerdutyErrorNotificationJob, Plugin, PluginRegistry, RetentionCleanupJob, SlackErrorNotificationJob, WebhookErrorNotificationJob
Constant Summary collapse
- VERSION =
"0.3.0"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Get or initialize configuration.
Class Method Summary collapse
-
.add_breadcrumb(message, metadata = nil) ⇒ Object
Add a custom breadcrumb to the current request’s trail No-ops if breadcrumbs are disabled or no buffer is initialized.
-
.configure {|configuration| ... } ⇒ Object
Configure the gem.
-
.on_critical_error(&block) ⇒ Object
Register a callback for when a critical error is logged.
-
.on_error_logged(&block) ⇒ Object
Register a callback for when any error is logged.
-
.on_error_resolved(&block) ⇒ Object
Register a callback for when an error is resolved.
-
.plugins ⇒ Array<Plugin>
Get all registered plugins.
-
.register_plugin(plugin) ⇒ Boolean
Register a plugin.
-
.reset_configuration! ⇒ Object
Reset configuration to defaults.
-
.unregister_plugin(plugin_name) ⇒ Object
Unregister a plugin by name.
Class Attribute Details
.configuration ⇒ Object
Get or initialize configuration
105 106 107 |
# File 'lib/rails_error_dashboard.rb', line 105 def configuration @configuration ||= Configuration.new end |
Class Method Details
.add_breadcrumb(message, metadata = nil) ⇒ Object
Add a custom breadcrumb to the current request’s trail No-ops if breadcrumbs are disabled or no buffer is initialized.
175 176 177 178 |
# File 'lib/rails_error_dashboard.rb', line 175 def self.(, = nil) return unless configuration. Services::BreadcrumbCollector.add("custom", , metadata: ) end |
.configure {|configuration| ... } ⇒ Object
Configure the gem
110 111 112 |
# File 'lib/rails_error_dashboard.rb', line 110 def configure yield(configuration) end |
.on_critical_error(&block) ⇒ Object
Register a callback for when a critical error is logged
155 156 157 |
# File 'lib/rails_error_dashboard.rb', line 155 def self.on_critical_error(&block) configuration.notification_callbacks[:critical_error] << block if block_given? end |
.on_error_logged(&block) ⇒ Object
Register a callback for when any error is logged
145 146 147 |
# File 'lib/rails_error_dashboard.rb', line 145 def self.on_error_logged(&block) configuration.notification_callbacks[:error_logged] << block if block_given? end |
.on_error_resolved(&block) ⇒ Object
Register a callback for when an error is resolved
165 166 167 |
# File 'lib/rails_error_dashboard.rb', line 165 def self.on_error_resolved(&block) configuration.notification_callbacks[:error_resolved] << block if block_given? end |
.plugins ⇒ Array<Plugin>
Get all registered plugins
135 136 137 |
# File 'lib/rails_error_dashboard.rb', line 135 def self.plugins PluginRegistry.plugins end |
.register_plugin(plugin) ⇒ Boolean
Register a plugin
123 124 125 |
# File 'lib/rails_error_dashboard.rb', line 123 def self.register_plugin(plugin) PluginRegistry.register(plugin) end |
.reset_configuration! ⇒ Object
Reset configuration to defaults
115 116 117 |
# File 'lib/rails_error_dashboard.rb', line 115 def reset_configuration! @configuration = Configuration.new end |
.unregister_plugin(plugin_name) ⇒ Object
Unregister a plugin by name
129 130 131 |
# File 'lib/rails_error_dashboard.rb', line 129 def self.unregister_plugin(plugin_name) PluginRegistry.unregister(plugin_name) end |