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.
- checksums.yaml +4 -4
- data/README.md +305 -703
- data/app/assets/stylesheets/rails_error_dashboard/_catppuccin_mocha.scss +107 -0
- data/app/assets/stylesheets/rails_error_dashboard/_components.scss +625 -0
- data/app/assets/stylesheets/rails_error_dashboard/_layout.scss +257 -0
- data/app/assets/stylesheets/rails_error_dashboard/_theme_variables.scss +203 -0
- data/app/assets/stylesheets/rails_error_dashboard/application.css +926 -15
- data/app/assets/stylesheets/rails_error_dashboard/application.css.map +7 -0
- data/app/assets/stylesheets/rails_error_dashboard/application.scss +61 -0
- data/app/controllers/rails_error_dashboard/application_controller.rb +18 -0
- data/app/controllers/rails_error_dashboard/errors_controller.rb +140 -4
- data/app/helpers/rails_error_dashboard/application_helper.rb +55 -0
- data/app/helpers/rails_error_dashboard/backtrace_helper.rb +91 -0
- data/app/helpers/rails_error_dashboard/overview_helper.rb +78 -0
- data/app/helpers/rails_error_dashboard/user_agent_helper.rb +118 -0
- data/app/jobs/rails_error_dashboard/application_job.rb +19 -0
- data/app/jobs/rails_error_dashboard/async_error_logging_job.rb +48 -0
- data/app/jobs/rails_error_dashboard/baseline_alert_job.rb +263 -0
- data/app/jobs/rails_error_dashboard/discord_error_notification_job.rb +4 -8
- data/app/jobs/rails_error_dashboard/email_error_notification_job.rb +2 -1
- data/app/jobs/rails_error_dashboard/pagerduty_error_notification_job.rb +5 -5
- data/app/jobs/rails_error_dashboard/slack_error_notification_job.rb +10 -6
- data/app/jobs/rails_error_dashboard/webhook_error_notification_job.rb +5 -6
- data/app/mailers/rails_error_dashboard/application_mailer.rb +1 -1
- data/app/mailers/rails_error_dashboard/error_notification_mailer.rb +1 -1
- data/app/models/rails_error_dashboard/cascade_pattern.rb +74 -0
- data/app/models/rails_error_dashboard/error_baseline.rb +100 -0
- data/app/models/rails_error_dashboard/error_comment.rb +27 -0
- data/app/models/rails_error_dashboard/error_log.rb +471 -3
- data/app/models/rails_error_dashboard/error_occurrence.rb +49 -0
- data/app/views/layouts/rails_error_dashboard.html.erb +816 -178
- data/app/views/layouts/rails_error_dashboard_old_backup.html.erb +383 -0
- data/app/views/rails_error_dashboard/error_notification_mailer/error_alert.html.erb +3 -10
- data/app/views/rails_error_dashboard/error_notification_mailer/error_alert.text.erb +1 -2
- data/app/views/rails_error_dashboard/errors/_error_row.html.erb +78 -0
- data/app/views/rails_error_dashboard/errors/_pattern_insights.html.erb +209 -0
- data/app/views/rails_error_dashboard/errors/_stats.html.erb +34 -0
- data/app/views/rails_error_dashboard/errors/_timeline.html.erb +167 -0
- data/app/views/rails_error_dashboard/errors/analytics.html.erb +152 -56
- data/app/views/rails_error_dashboard/errors/correlation.html.erb +373 -0
- data/app/views/rails_error_dashboard/errors/index.html.erb +294 -138
- data/app/views/rails_error_dashboard/errors/overview.html.erb +253 -0
- data/app/views/rails_error_dashboard/errors/platform_comparison.html.erb +399 -0
- data/app/views/rails_error_dashboard/errors/show.html.erb +781 -65
- data/config/routes.rb +9 -0
- data/db/migrate/20251225071314_add_optimized_indexes_to_error_logs.rb +66 -0
- data/db/migrate/20251225074653_remove_environment_from_error_logs.rb +26 -0
- data/db/migrate/20251225085859_add_enhanced_metrics_to_error_logs.rb +12 -0
- data/db/migrate/20251225093603_add_similarity_tracking_to_error_logs.rb +9 -0
- data/db/migrate/20251225100236_create_error_occurrences.rb +31 -0
- data/db/migrate/20251225101920_create_cascade_patterns.rb +33 -0
- data/db/migrate/20251225102500_create_error_baselines.rb +38 -0
- data/db/migrate/20251226020000_add_workflow_fields_to_error_logs.rb +27 -0
- data/db/migrate/20251226020100_create_error_comments.rb +18 -0
- data/lib/generators/rails_error_dashboard/install/install_generator.rb +276 -1
- data/lib/generators/rails_error_dashboard/install/templates/initializer.rb +272 -37
- data/lib/generators/rails_error_dashboard/solid_queue/solid_queue_generator.rb +36 -0
- data/lib/generators/rails_error_dashboard/solid_queue/templates/queue.yml +55 -0
- data/lib/rails_error_dashboard/commands/batch_delete_errors.rb +1 -1
- data/lib/rails_error_dashboard/commands/batch_resolve_errors.rb +2 -2
- data/lib/rails_error_dashboard/commands/log_error.rb +272 -7
- data/lib/rails_error_dashboard/commands/resolve_error.rb +16 -0
- data/lib/rails_error_dashboard/configuration.rb +90 -5
- data/lib/rails_error_dashboard/error_reporter.rb +15 -7
- data/lib/rails_error_dashboard/logger.rb +105 -0
- data/lib/rails_error_dashboard/middleware/error_catcher.rb +17 -10
- data/lib/rails_error_dashboard/plugin.rb +6 -3
- data/lib/rails_error_dashboard/plugin_registry.rb +2 -2
- data/lib/rails_error_dashboard/plugins/audit_log_plugin.rb +0 -1
- data/lib/rails_error_dashboard/plugins/jira_integration_plugin.rb +3 -4
- data/lib/rails_error_dashboard/plugins/metrics_plugin.rb +1 -3
- data/lib/rails_error_dashboard/queries/analytics_stats.rb +44 -6
- data/lib/rails_error_dashboard/queries/baseline_stats.rb +107 -0
- data/lib/rails_error_dashboard/queries/co_occurring_errors.rb +86 -0
- data/lib/rails_error_dashboard/queries/dashboard_stats.rb +242 -2
- data/lib/rails_error_dashboard/queries/error_cascades.rb +74 -0
- data/lib/rails_error_dashboard/queries/error_correlation.rb +375 -0
- data/lib/rails_error_dashboard/queries/errors_list.rb +106 -10
- data/lib/rails_error_dashboard/queries/filter_options.rb +0 -1
- data/lib/rails_error_dashboard/queries/platform_comparison.rb +254 -0
- data/lib/rails_error_dashboard/queries/similar_errors.rb +93 -0
- data/lib/rails_error_dashboard/services/backtrace_parser.rb +113 -0
- data/lib/rails_error_dashboard/services/baseline_alert_throttler.rb +88 -0
- data/lib/rails_error_dashboard/services/baseline_calculator.rb +269 -0
- data/lib/rails_error_dashboard/services/cascade_detector.rb +95 -0
- data/lib/rails_error_dashboard/services/pattern_detector.rb +268 -0
- data/lib/rails_error_dashboard/services/similarity_calculator.rb +144 -0
- data/lib/rails_error_dashboard/value_objects/error_context.rb +27 -1
- data/lib/rails_error_dashboard/version.rb +1 -1
- data/lib/rails_error_dashboard.rb +57 -7
- metadata +69 -10
- data/app/models/rails_error_dashboard/application_record.rb +0 -5
- data/lib/rails_error_dashboard/queries/developer_insights.rb +0 -277
- data/lib/rails_error_dashboard/queries/errors_list_v2.rb +0 -149
- 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
|
-
#
|
|
6
|
-
config.dashboard_username = ENV.fetch("ERROR_DASHBOARD_USER", "
|
|
7
|
-
config.dashboard_password = ENV.fetch("ERROR_DASHBOARD_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
|
-
#
|
|
18
|
-
#
|
|
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
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
#
|
|
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
|
-
|
|
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
|
-
#
|
|
50
|
-
#
|
|
51
|
-
|
|
109
|
+
# ============================================================================
|
|
110
|
+
# PERFORMANCE & SCALABILITY
|
|
111
|
+
# ============================================================================
|
|
52
112
|
|
|
53
|
-
|
|
54
|
-
#
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
#
|
|
59
|
-
|
|
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
|
-
|
|
62
|
-
#
|
|
63
|
-
config.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|