rails_error_dashboard 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +305 -703
  3. data/app/assets/stylesheets/rails_error_dashboard/_catppuccin_mocha.scss +107 -0
  4. data/app/assets/stylesheets/rails_error_dashboard/_components.scss +625 -0
  5. data/app/assets/stylesheets/rails_error_dashboard/_layout.scss +257 -0
  6. data/app/assets/stylesheets/rails_error_dashboard/_theme_variables.scss +203 -0
  7. data/app/assets/stylesheets/rails_error_dashboard/application.css +926 -15
  8. data/app/assets/stylesheets/rails_error_dashboard/application.css.map +7 -0
  9. data/app/assets/stylesheets/rails_error_dashboard/application.scss +61 -0
  10. data/app/controllers/rails_error_dashboard/application_controller.rb +18 -0
  11. data/app/controllers/rails_error_dashboard/errors_controller.rb +140 -4
  12. data/app/helpers/rails_error_dashboard/application_helper.rb +55 -0
  13. data/app/helpers/rails_error_dashboard/backtrace_helper.rb +91 -0
  14. data/app/helpers/rails_error_dashboard/overview_helper.rb +78 -0
  15. data/app/helpers/rails_error_dashboard/user_agent_helper.rb +118 -0
  16. data/app/jobs/rails_error_dashboard/application_job.rb +19 -0
  17. data/app/jobs/rails_error_dashboard/async_error_logging_job.rb +48 -0
  18. data/app/jobs/rails_error_dashboard/baseline_alert_job.rb +263 -0
  19. data/app/jobs/rails_error_dashboard/discord_error_notification_job.rb +4 -8
  20. data/app/jobs/rails_error_dashboard/email_error_notification_job.rb +2 -1
  21. data/app/jobs/rails_error_dashboard/pagerduty_error_notification_job.rb +5 -5
  22. data/app/jobs/rails_error_dashboard/slack_error_notification_job.rb +10 -6
  23. data/app/jobs/rails_error_dashboard/webhook_error_notification_job.rb +5 -6
  24. data/app/mailers/rails_error_dashboard/application_mailer.rb +1 -1
  25. data/app/mailers/rails_error_dashboard/error_notification_mailer.rb +1 -1
  26. data/app/models/rails_error_dashboard/cascade_pattern.rb +74 -0
  27. data/app/models/rails_error_dashboard/error_baseline.rb +100 -0
  28. data/app/models/rails_error_dashboard/error_comment.rb +27 -0
  29. data/app/models/rails_error_dashboard/error_log.rb +471 -3
  30. data/app/models/rails_error_dashboard/error_occurrence.rb +49 -0
  31. data/app/views/layouts/rails_error_dashboard.html.erb +816 -178
  32. data/app/views/layouts/rails_error_dashboard_old_backup.html.erb +383 -0
  33. data/app/views/rails_error_dashboard/error_notification_mailer/error_alert.html.erb +3 -10
  34. data/app/views/rails_error_dashboard/error_notification_mailer/error_alert.text.erb +1 -2
  35. data/app/views/rails_error_dashboard/errors/_error_row.html.erb +78 -0
  36. data/app/views/rails_error_dashboard/errors/_pattern_insights.html.erb +209 -0
  37. data/app/views/rails_error_dashboard/errors/_stats.html.erb +34 -0
  38. data/app/views/rails_error_dashboard/errors/_timeline.html.erb +167 -0
  39. data/app/views/rails_error_dashboard/errors/analytics.html.erb +152 -56
  40. data/app/views/rails_error_dashboard/errors/correlation.html.erb +373 -0
  41. data/app/views/rails_error_dashboard/errors/index.html.erb +294 -138
  42. data/app/views/rails_error_dashboard/errors/overview.html.erb +253 -0
  43. data/app/views/rails_error_dashboard/errors/platform_comparison.html.erb +399 -0
  44. data/app/views/rails_error_dashboard/errors/show.html.erb +781 -65
  45. data/config/routes.rb +9 -0
  46. data/db/migrate/20251225071314_add_optimized_indexes_to_error_logs.rb +66 -0
  47. data/db/migrate/20251225074653_remove_environment_from_error_logs.rb +26 -0
  48. data/db/migrate/20251225085859_add_enhanced_metrics_to_error_logs.rb +12 -0
  49. data/db/migrate/20251225093603_add_similarity_tracking_to_error_logs.rb +9 -0
  50. data/db/migrate/20251225100236_create_error_occurrences.rb +31 -0
  51. data/db/migrate/20251225101920_create_cascade_patterns.rb +33 -0
  52. data/db/migrate/20251225102500_create_error_baselines.rb +38 -0
  53. data/db/migrate/20251226020000_add_workflow_fields_to_error_logs.rb +27 -0
  54. data/db/migrate/20251226020100_create_error_comments.rb +18 -0
  55. data/lib/generators/rails_error_dashboard/install/install_generator.rb +276 -1
  56. data/lib/generators/rails_error_dashboard/install/templates/initializer.rb +272 -37
  57. data/lib/generators/rails_error_dashboard/solid_queue/solid_queue_generator.rb +36 -0
  58. data/lib/generators/rails_error_dashboard/solid_queue/templates/queue.yml +55 -0
  59. data/lib/rails_error_dashboard/commands/batch_delete_errors.rb +1 -1
  60. data/lib/rails_error_dashboard/commands/batch_resolve_errors.rb +2 -2
  61. data/lib/rails_error_dashboard/commands/log_error.rb +272 -7
  62. data/lib/rails_error_dashboard/commands/resolve_error.rb +16 -0
  63. data/lib/rails_error_dashboard/configuration.rb +90 -5
  64. data/lib/rails_error_dashboard/error_reporter.rb +15 -7
  65. data/lib/rails_error_dashboard/logger.rb +105 -0
  66. data/lib/rails_error_dashboard/middleware/error_catcher.rb +17 -10
  67. data/lib/rails_error_dashboard/plugin.rb +6 -3
  68. data/lib/rails_error_dashboard/plugin_registry.rb +2 -2
  69. data/lib/rails_error_dashboard/plugins/audit_log_plugin.rb +0 -1
  70. data/lib/rails_error_dashboard/plugins/jira_integration_plugin.rb +3 -4
  71. data/lib/rails_error_dashboard/plugins/metrics_plugin.rb +1 -3
  72. data/lib/rails_error_dashboard/queries/analytics_stats.rb +44 -6
  73. data/lib/rails_error_dashboard/queries/baseline_stats.rb +107 -0
  74. data/lib/rails_error_dashboard/queries/co_occurring_errors.rb +86 -0
  75. data/lib/rails_error_dashboard/queries/dashboard_stats.rb +242 -2
  76. data/lib/rails_error_dashboard/queries/error_cascades.rb +74 -0
  77. data/lib/rails_error_dashboard/queries/error_correlation.rb +375 -0
  78. data/lib/rails_error_dashboard/queries/errors_list.rb +106 -10
  79. data/lib/rails_error_dashboard/queries/filter_options.rb +0 -1
  80. data/lib/rails_error_dashboard/queries/platform_comparison.rb +254 -0
  81. data/lib/rails_error_dashboard/queries/similar_errors.rb +93 -0
  82. data/lib/rails_error_dashboard/services/backtrace_parser.rb +113 -0
  83. data/lib/rails_error_dashboard/services/baseline_alert_throttler.rb +88 -0
  84. data/lib/rails_error_dashboard/services/baseline_calculator.rb +269 -0
  85. data/lib/rails_error_dashboard/services/cascade_detector.rb +95 -0
  86. data/lib/rails_error_dashboard/services/pattern_detector.rb +268 -0
  87. data/lib/rails_error_dashboard/services/similarity_calculator.rb +144 -0
  88. data/lib/rails_error_dashboard/value_objects/error_context.rb +27 -1
  89. data/lib/rails_error_dashboard/version.rb +1 -1
  90. data/lib/rails_error_dashboard.rb +57 -7
  91. metadata +69 -10
  92. data/app/models/rails_error_dashboard/application_record.rb +0 -5
  93. data/lib/rails_error_dashboard/queries/developer_insights.rb +0 -277
  94. data/lib/rails_error_dashboard/queries/errors_list_v2.rb +0 -149
  95. data/lib/tasks/rails_error_dashboard_tasks.rake +0 -4
@@ -1,64 +1,299 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  RailsErrorDashboard.configure do |config|
4
+ # ============================================================================
5
+ # AUTHENTICATION (Always Required)
6
+ # ============================================================================
7
+
4
8
  # Dashboard authentication credentials
5
- # Change these in production or use environment variables
6
- config.dashboard_username = ENV.fetch("ERROR_DASHBOARD_USER", "admin")
7
- config.dashboard_password = ENV.fetch("ERROR_DASHBOARD_PASSWORD", "password")
9
+ # ⚠️ CHANGE THESE BEFORE PRODUCTION! ⚠️
10
+ config.dashboard_username = ENV.fetch("ERROR_DASHBOARD_USER", "gandalf")
11
+ config.dashboard_password = ENV.fetch("ERROR_DASHBOARD_PASSWORD", "youshallnotpass")
8
12
 
9
13
  # Require authentication for dashboard access
10
- # Set to false to disable authentication (not recommended in production)
11
14
  config.require_authentication = true
12
15
 
13
16
  # Require authentication even in development mode
14
- # Set to true if you want to test authentication in development
15
17
  config.require_authentication_in_development = false
16
18
 
17
- # User model for associations (defaults to 'User')
18
- # Change this if your user model has a different name
19
+ # ============================================================================
20
+ # CORE FEATURES (Always Enabled)
21
+ # ============================================================================
22
+
23
+ # Error capture via middleware and Rails.error subscriber
24
+ config.enable_middleware = true
25
+ config.enable_error_subscriber = true
26
+
27
+ # User model for error associations
19
28
  config.user_model = "User"
20
29
 
21
- # === NOTIFICATION SETTINGS ===
22
- #
23
- # Notifications are sent asynchronously via the :error_notifications queue
24
- # Works with: Solid Queue (Rails 8.1+), Sidekiq, Delayed Job, Resque, etc.
25
- #
26
- # For Sidekiq, add to config/sidekiq.yml:
27
- # :queues:
28
- # - error_notifications
29
- # - default
30
- #
31
- # For Solid Queue (Rails 8.1+), add to config/queue.yml:
32
- # workers:
33
- # - queues: error_notifications
34
- # threads: 3
35
-
36
- # Slack notifications
30
+ # Error retention policy (days to keep errors before auto-deletion)
31
+ config.retention_days = 90
32
+
33
+ # ============================================================================
34
+ # NOTIFICATION SETTINGS
35
+ # ============================================================================
36
+ # Configure which notification channels you want to use.
37
+ # You can enable/disable any of these at any time by changing true/false.
38
+
39
+ <% if @enable_slack -%>
40
+ # Slack Notifications - ENABLED
37
41
  config.enable_slack_notifications = true
38
42
  config.slack_webhook_url = ENV["SLACK_WEBHOOK_URL"]
43
+ # To disable: Set config.enable_slack_notifications = false
44
+
45
+ <% else -%>
46
+ # Slack Notifications - DISABLED
47
+ # To enable: Set config.enable_slack_notifications = true and configure webhook URL
48
+ config.enable_slack_notifications = false
49
+ # config.slack_webhook_url = ENV["SLACK_WEBHOOK_URL"]
39
50
 
40
- # Email notifications
51
+ <% end -%>
52
+ <% if @enable_email -%>
53
+ # Email Notifications - ENABLED
41
54
  config.enable_email_notifications = true
42
55
  config.notification_email_recipients = ENV.fetch("ERROR_NOTIFICATION_EMAILS", "").split(",").map(&:strip)
43
56
  config.notification_email_from = ENV.fetch("ERROR_NOTIFICATION_FROM", "errors@example.com")
57
+ # To disable: Set config.enable_email_notifications = false
58
+
59
+ <% else -%>
60
+ # Email Notifications - DISABLED
61
+ # To enable: Set config.enable_email_notifications = true and configure recipients
62
+ config.enable_email_notifications = false
63
+ # config.notification_email_recipients = ENV.fetch("ERROR_NOTIFICATION_EMAILS", "").split(",").map(&:strip)
64
+ # config.notification_email_from = ENV.fetch("ERROR_NOTIFICATION_FROM", "errors@example.com")
65
+
66
+ <% end -%>
67
+ <% if @enable_discord -%>
68
+ # Discord Notifications - ENABLED
69
+ config.enable_discord_notifications = true
70
+ config.discord_webhook_url = ENV["DISCORD_WEBHOOK_URL"]
71
+ # To disable: Set config.enable_discord_notifications = false
72
+
73
+ <% else -%>
74
+ # Discord Notifications - DISABLED
75
+ # To enable: Set config.enable_discord_notifications = true and configure webhook URL
76
+ config.enable_discord_notifications = false
77
+ # config.discord_webhook_url = ENV["DISCORD_WEBHOOK_URL"]
44
78
 
79
+ <% end -%>
80
+ <% if @enable_pagerduty -%>
81
+ # PagerDuty Integration - ENABLED (critical errors only)
82
+ config.enable_pagerduty_notifications = true
83
+ config.pagerduty_integration_key = ENV["PAGERDUTY_INTEGRATION_KEY"]
84
+ # To disable: Set config.enable_pagerduty_notifications = false
85
+
86
+ <% else -%>
87
+ # PagerDuty Integration - DISABLED
88
+ # To enable: Set config.enable_pagerduty_notifications = true and configure integration key
89
+ config.enable_pagerduty_notifications = false
90
+ # config.pagerduty_integration_key = ENV["PAGERDUTY_INTEGRATION_KEY"]
91
+
92
+ <% end -%>
93
+ <% if @enable_webhooks -%>
94
+ # Generic Webhook Notifications - ENABLED
95
+ config.enable_webhook_notifications = true
96
+ config.webhook_urls = ENV.fetch("WEBHOOK_URLS", "").split(",").map(&:strip).reject(&:empty?)
97
+ # To disable: Set config.enable_webhook_notifications = false
98
+
99
+ <% else -%>
100
+ # Generic Webhook Notifications - DISABLED
101
+ # To enable: Set config.enable_webhook_notifications = true and configure webhook URLs
102
+ config.enable_webhook_notifications = false
103
+ # config.webhook_urls = ENV.fetch("WEBHOOK_URLS", "").split(",").map(&:strip).reject(&:empty?)
104
+
105
+ <% end -%>
45
106
  # Dashboard base URL (used in notification links)
46
- # Example: 'https://myapp.com' or 'http://localhost:3000'
47
107
  config.dashboard_base_url = ENV["DASHBOARD_BASE_URL"]
48
108
 
49
- # Use a separate database for error logs (optional)
50
- # See documentation for setup instructions: docs/SEPARATE_ERROR_DATABASE.md
51
- config.use_separate_database = ENV.fetch("USE_SEPARATE_ERROR_DB", "false") == "true"
109
+ # ============================================================================
110
+ # PERFORMANCE & SCALABILITY
111
+ # ============================================================================
52
112
 
53
- # Retention policy - number of days to keep error logs
54
- # Old errors will be automatically deleted after this many days
55
- config.retention_days = 90
113
+ <% if @enable_async_logging -%>
114
+ # Async Error Logging - ENABLED
115
+ # Errors will be logged in background jobs for better performance
116
+ config.async_logging = true
117
+ config.async_adapter = :sidekiq # Options: :sidekiq, :solid_queue, :async
118
+ # To disable: Set config.async_logging = false
56
119
 
57
- # Enable/disable error catching middleware
58
- # Set to false if you want to handle errors differently
59
- config.enable_middleware = true
120
+ <% else -%>
121
+ # Async Error Logging - DISABLED
122
+ # Errors are logged synchronously (blocking)
123
+ # To enable: Set config.async_logging = true and configure adapter
124
+ config.async_logging = false
125
+ # config.async_adapter = :sidekiq # Options: :sidekiq, :solid_queue, :async
60
126
 
61
- # Enable/disable Rails.error subscriber
62
- # Set to false if you don't want to use Rails error reporting
63
- config.enable_error_subscriber = true
127
+ <% end -%>
128
+ # Backtrace size limiting (reduces storage by ~80%)
129
+ config.max_backtrace_lines = 50
130
+
131
+ <% if @enable_error_sampling -%>
132
+ # Error Sampling - ENABLED
133
+ # Reduce volume by logging only a percentage of non-critical errors
134
+ # Critical errors are ALWAYS logged regardless of sampling rate
135
+ config.sampling_rate = 0.1 # 10% - Adjust as needed (0.0 to 1.0)
136
+ # To disable: Set config.sampling_rate = 1.0 (100%)
137
+
138
+ <% else -%>
139
+ # Error Sampling - DISABLED
140
+ # All errors are logged (100% sampling rate)
141
+ # To enable: Set config.sampling_rate < 1.0 (e.g., 0.1 for 10%)
142
+ config.sampling_rate = 1.0
143
+
144
+ <% end -%>
145
+ # Ignored exceptions (skip logging these)
146
+ # config.ignored_exceptions = [
147
+ # "ActionController::RoutingError",
148
+ # "ActionController::InvalidAuthenticityToken",
149
+ # /^ActiveRecord::RecordNotFound/
150
+ # ]
151
+
152
+ # ============================================================================
153
+ # DATABASE CONFIGURATION
154
+ # ============================================================================
155
+
156
+ <% if @enable_separate_database -%>
157
+ # Separate Error Database - ENABLED
158
+ # Errors will be stored in a dedicated database
159
+ # See docs/guides/DATABASE_OPTIONS.md for setup instructions
160
+ config.use_separate_database = true
161
+ # To disable: Set config.use_separate_database = false
162
+
163
+ <% else -%>
164
+ # Separate Error Database - DISABLED
165
+ # Errors are stored in your main application database
166
+ # To enable: Set config.use_separate_database = true and configure database.yml
167
+ config.use_separate_database = false
168
+
169
+ <% end -%>
170
+ # ============================================================================
171
+ # ADVANCED ANALYTICS
172
+ # ============================================================================
173
+
174
+ <% if @enable_baseline_alerts -%>
175
+ # Baseline Anomaly Alerts - ENABLED
176
+ # Automatically detect when error rates exceed normal patterns
177
+ config.enable_baseline_alerts = true
178
+ config.baseline_alert_threshold_std_devs = 2.0 # Alert when > 2 std devs above baseline
179
+ config.baseline_alert_severities = [ :critical, :high ]
180
+ config.baseline_alert_cooldown_minutes = 120 # 2 hours between alerts
181
+ # To disable: Set config.enable_baseline_alerts = false
182
+
183
+ <% else -%>
184
+ # Baseline Anomaly Alerts - DISABLED
185
+ # To enable: Set config.enable_baseline_alerts = true
186
+ config.enable_baseline_alerts = false
187
+ # config.baseline_alert_threshold_std_devs = 2.0
188
+ # config.baseline_alert_severities = [ :critical, :high ]
189
+ # config.baseline_alert_cooldown_minutes = 120
190
+
191
+ <% end -%>
192
+ <% if @enable_similar_errors -%>
193
+ # Fuzzy Error Matching - ENABLED
194
+ # Find similar errors even with different error_hashes
195
+ config.enable_similar_errors = true
196
+ # To disable: Set config.enable_similar_errors = false
197
+
198
+ <% else -%>
199
+ # Fuzzy Error Matching - DISABLED
200
+ # To enable: Set config.enable_similar_errors = true
201
+ config.enable_similar_errors = false
202
+
203
+ <% end -%>
204
+ <% if @enable_co_occurring_errors -%>
205
+ # Co-occurring Errors - ENABLED
206
+ # Detect errors that happen together in time
207
+ config.enable_co_occurring_errors = true
208
+ # To disable: Set config.enable_co_occurring_errors = false
209
+
210
+ <% else -%>
211
+ # Co-occurring Errors - DISABLED
212
+ # To enable: Set config.enable_co_occurring_errors = true
213
+ config.enable_co_occurring_errors = false
214
+
215
+ <% end -%>
216
+ <% if @enable_error_cascades -%>
217
+ # Error Cascade Detection - ENABLED
218
+ # Identify error chains (A causes B causes C)
219
+ config.enable_error_cascades = true
220
+ # To disable: Set config.enable_error_cascades = false
221
+
222
+ <% else -%>
223
+ # Error Cascade Detection - DISABLED
224
+ # To enable: Set config.enable_error_cascades = true
225
+ config.enable_error_cascades = false
226
+
227
+ <% end -%>
228
+ <% if @enable_error_correlation -%>
229
+ # Error Correlation Analysis - ENABLED
230
+ # Correlate errors with versions, users, and time
231
+ config.enable_error_correlation = true
232
+ # To disable: Set config.enable_error_correlation = false
233
+
234
+ <% else -%>
235
+ # Error Correlation Analysis - DISABLED
236
+ # To enable: Set config.enable_error_correlation = true
237
+ config.enable_error_correlation = false
238
+
239
+ <% end -%>
240
+ <% if @enable_platform_comparison -%>
241
+ # Platform Comparison - ENABLED
242
+ # Compare iOS vs Android vs Web health metrics
243
+ config.enable_platform_comparison = true
244
+ # To disable: Set config.enable_platform_comparison = false
245
+
246
+ <% else -%>
247
+ # Platform Comparison - DISABLED
248
+ # To enable: Set config.enable_platform_comparison = true
249
+ config.enable_platform_comparison = false
250
+
251
+ <% end -%>
252
+ <% if @enable_occurrence_patterns -%>
253
+ # Occurrence Pattern Detection - ENABLED
254
+ # Detect cyclical patterns and error bursts
255
+ config.enable_occurrence_patterns = true
256
+ # To disable: Set config.enable_occurrence_patterns = false
257
+
258
+ <% else -%>
259
+ # Occurrence Pattern Detection - DISABLED
260
+ # To enable: Set config.enable_occurrence_patterns = true
261
+ config.enable_occurrence_patterns = false
262
+
263
+ <% end -%>
264
+ # ============================================================================
265
+ # INTERNAL LOGGING (Silent by Default)
266
+ # ============================================================================
267
+ # Rails Error Dashboard logging is SILENT by default to keep your logs clean.
268
+ # Enable only for debugging gem issues or troubleshooting setup.
269
+
270
+ # Enable internal logging (default: false - silent)
271
+ config.enable_internal_logging = false
272
+
273
+ # Log level (default: :silent)
274
+ # Options: :debug, :info, :warn, :error, :silent
275
+ config.log_level = :silent
276
+
277
+ # Example: Enable verbose logging for debugging
278
+ # config.enable_internal_logging = true
279
+ # config.log_level = :debug
280
+
281
+ # Example: Log only errors (troubleshooting)
282
+ # config.enable_internal_logging = true
283
+ # config.log_level = :error
284
+
285
+ # ============================================================================
286
+ # ADDITIONAL CONFIGURATION
287
+ # ============================================================================
288
+
289
+ # Custom severity rules (override automatic severity classification)
290
+ # config.custom_severity_rules = {
291
+ # "PaymentError" => :critical,
292
+ # "ValidationError" => :low
293
+ # }
294
+
295
+ # Enhanced metrics (optional)
296
+ config.app_version = ENV["APP_VERSION"]
297
+ config.git_sha = ENV["GIT_SHA"]
298
+ # config.total_users_for_impact = 10000 # For user impact % calculation
64
299
  end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsErrorDashboard
4
+ module Generators
5
+ # Generator for Solid Queue configuration
6
+ # Usage: rails generate rails_error_dashboard:solid_queue
7
+ class SolidQueueGenerator < Rails::Generators::Base
8
+ source_root File.expand_path("templates", __dir__)
9
+
10
+ desc "Creates Solid Queue configuration for RailsErrorDashboard"
11
+
12
+ def create_queue_config
13
+ template "queue.yml", "config/queue.yml"
14
+ end
15
+
16
+ def show_instructions
17
+ say "\n" + "=" * 80, :green
18
+ say "Solid Queue configuration created!", :green
19
+ say "=" * 80, :green
20
+ say "\nNext steps:", :yellow
21
+ say " 1. Install Solid Queue gem (if not already):", :cyan
22
+ say " bundle add solid_queue", :white
23
+ say "\n 2. Run Solid Queue migrations:", :cyan
24
+ say " bin/rails solid_queue:install", :white
25
+ say "\n 3. Set ActiveJob adapter in config/application.rb:", :cyan
26
+ say " config.active_job.queue_adapter = :solid_queue", :white
27
+ say "\n 4. Start Solid Queue worker:", :cyan
28
+ say " bin/jobs", :white
29
+ say "\n 5. Enable async logging in config/initializers/rails_error_dashboard.rb:", :cyan
30
+ say " config.async_logging = true", :white
31
+ say " config.async_adapter = :solid_queue", :white
32
+ say "\n" + "=" * 80, :green
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,55 @@
1
+ # Solid Queue configuration for RailsErrorDashboard
2
+ #
3
+ # This file configures workers for error logging and notifications.
4
+ # Adjust threads and processes based on your application's needs.
5
+
6
+ # Development environment - optimized for low resource usage
7
+ development:
8
+ workers:
9
+ # Error notifications (Slack, Email, Discord, PagerDuty, Webhooks)
10
+ - queues: error_notifications
11
+ threads: 2
12
+ processes: 1
13
+ polling_interval: 1
14
+
15
+ # Default queue (includes async error logging)
16
+ - queues: default
17
+ threads: 3
18
+ processes: 1
19
+ polling_interval: 1
20
+
21
+ # Test environment - minimal configuration
22
+ test:
23
+ workers:
24
+ - queues: "*"
25
+ threads: 1
26
+ processes: 1
27
+ polling_interval: 0.1
28
+
29
+ # Production environment - optimized for throughput
30
+ production:
31
+ workers:
32
+ # Error notifications - lower concurrency (external API calls)
33
+ - queues: error_notifications
34
+ threads: 3
35
+ processes: 1
36
+ polling_interval: 0.5
37
+
38
+ # Default queue - higher concurrency (database operations)
39
+ - queues: default
40
+ threads: 5
41
+ processes: 2
42
+ polling_interval: 0.5
43
+
44
+ # Staging environment - similar to production but scaled down
45
+ staging:
46
+ workers:
47
+ - queues: error_notifications
48
+ threads: 2
49
+ processes: 1
50
+ polling_interval: 0.5
51
+
52
+ - queues: default
53
+ threads: 3
54
+ processes: 1
55
+ polling_interval: 0.5
@@ -32,7 +32,7 @@ module RailsErrorDashboard
32
32
  errors: []
33
33
  }
34
34
  rescue => e
35
- Rails.logger.error("Batch delete failed: #{e.message}")
35
+ RailsErrorDashboard::Logger.error("Batch delete failed: #{e.message}")
36
36
  { success: false, count: 0, total: @error_ids.size, errors: [ e.message ] }
37
37
  end
38
38
  end
@@ -37,7 +37,7 @@ module RailsErrorDashboard
37
37
  resolved_errors << error
38
38
  rescue => e
39
39
  failed_ids << error.id
40
- Rails.logger.error("Failed to resolve error #{error.id}: #{e.message}")
40
+ RailsErrorDashboard::Logger.error("Failed to resolve error #{error.id}: #{e.message}")
41
41
  end
42
42
  end
43
43
 
@@ -52,7 +52,7 @@ module RailsErrorDashboard
52
52
  errors: failed_ids.empty? ? [] : [ "Failed to resolve #{failed_ids.size} error(s)" ]
53
53
  }
54
54
  rescue => e
55
- Rails.logger.error("Batch resolve failed: #{e.message}")
55
+ RailsErrorDashboard::Logger.error("Batch resolve failed: #{e.message}")
56
56
  { success: false, count: 0, total: @error_ids.size, errors: [ e.message ] }
57
57
  end
58
58
  end