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
data/README.md
CHANGED
|
@@ -4,840 +4,438 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://github.com/AnjanJ/rails_error_dashboard/actions)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Self-hosted Rails error monitoring โ free, forever.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Own your errors. Own your stack. Zero monthly fees.**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
A fully open-source, self-hosted error dashboard for solo founders, indie hackers, and small teams who want complete control without the SaaS bills.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
```ruby
|
|
14
|
+
gem 'rails_error_dashboard'
|
|
15
|
+
```
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
**5-minute setup** ยท **Works out-of-the-box** ยท **100% Rails + Postgres** ยท **No vendor lock-in**
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [Features](#-features)
|
|
20
|
-
- [Installation](#-installation)
|
|
21
|
-
- [Configuration](#๏ธ-configuration)
|
|
22
|
-
- [Usage](#-usage)
|
|
23
|
-
- [Automatic Error Tracking](#automatic-error-tracking)
|
|
24
|
-
- [Manual Error Logging](#manual-error-logging)
|
|
25
|
-
- [Frontend & Mobile Error Reporting](#frontend--mobile-error-reporting)
|
|
26
|
-
- [Optional Separate Database](#๏ธ-optional-separate-database)
|
|
27
|
-
- [Advanced Features](#-advanced-features)
|
|
28
|
-
- [Notification System](#-notification-system)
|
|
29
|
-
- [Platform Detection](#platform-detection)
|
|
30
|
-
- [Architecture Details](#-architecture-details)
|
|
31
|
-
- [Documentation](#-documentation)
|
|
32
|
-
- [Contributing](#-contributing)
|
|
33
|
-
- [License](#-license)
|
|
19
|
+
---
|
|
34
20
|
|
|
35
|
-
|
|
21
|
+
### โ ๏ธ BETA SOFTWARE
|
|
22
|
+
This Rails Engine is in beta and under active development. While functional and tested (850+ tests passing), the API may change before v1.0.0. Use in production at your own discretion.
|
|
36
23
|
|
|
37
|
-
|
|
38
|
-
- **Automatic error capture** from Rails controllers, jobs, services, and middleware
|
|
39
|
-
- **Frontend & mobile support** - React, React Native, Vue, Angular, Flutter, and more
|
|
40
|
-
- **Platform detection** (iOS/Android/Web/API) using user agent parsing
|
|
41
|
-
- **User context tracking** with optional user associations
|
|
42
|
-
- **Request context** including URL, params, IP address, component/screen
|
|
43
|
-
- **Full stack traces** for debugging (Ruby + JavaScript)
|
|
44
|
-
|
|
45
|
-
### ๐ Beautiful Dashboard
|
|
46
|
-
- **Modern UI** with Bootstrap 5
|
|
47
|
-
- **Dark/Light mode** with theme switcher
|
|
48
|
-
- **Responsive design** for mobile and desktop
|
|
49
|
-
- **Real-time statistics** and error counts
|
|
50
|
-
- **Search and filtering** by type, platform, environment
|
|
51
|
-
- **Fast pagination** with Pagy (40x faster than Kaminari)
|
|
52
|
-
|
|
53
|
-
### ๐ Analytics & Insights
|
|
54
|
-
- **Time-series charts** showing error trends
|
|
55
|
-
- **Breakdown by type**, platform, and environment
|
|
56
|
-
- **Resolution rate tracking**
|
|
57
|
-
- **Top affected users**
|
|
58
|
-
- **Mobile vs API analysis**
|
|
59
|
-
- **Customizable date ranges** (7, 14, 30, 90 days)
|
|
60
|
-
|
|
61
|
-
### โ
Resolution Tracking
|
|
62
|
-
- Mark errors as resolved
|
|
63
|
-
- Add resolution comments
|
|
64
|
-
- Link to PRs, commits, or issues
|
|
65
|
-
- Track resolver name and timestamp
|
|
66
|
-
- View related errors
|
|
67
|
-
- **Batch operations** - resolve or delete multiple errors at once
|
|
68
|
-
|
|
69
|
-
### ๐จ Multi-Channel Alerting
|
|
70
|
-
- **5 notification backends**: Email, Slack, Discord, PagerDuty, Webhooks
|
|
71
|
-
- **Slack notifications** with beautifully formatted messages
|
|
72
|
-
- **Discord notifications** with rich embeds and color-coded severity
|
|
73
|
-
- **PagerDuty integration** for critical errors (on-call escalation)
|
|
74
|
-
- **Custom webhooks** for integration with any monitoring service
|
|
75
|
-
- **Email alerts** with HTML templates to multiple recipients
|
|
76
|
-
- **Instant notifications** when errors occur (async background jobs)
|
|
77
|
-
- **Rich context** including user, platform, environment, stack trace
|
|
78
|
-
- **Direct links** to view full error details in dashboard
|
|
79
|
-
- **Customizable** - enable/disable channels independently
|
|
80
|
-
|
|
81
|
-
See [NOTIFICATION_CONFIGURATION.md](NOTIFICATION_CONFIGURATION.md) for detailed setup.
|
|
82
|
-
|
|
83
|
-
### ๐ Security & Configuration
|
|
84
|
-
- **HTTP Basic Auth** (configurable)
|
|
85
|
-
- **Environment-based settings**
|
|
86
|
-
- **Optional separate database** for performance isolation
|
|
87
|
-
|
|
88
|
-
### ๐ Plugin System
|
|
89
|
-
- **Extensible architecture** for custom integrations
|
|
90
|
-
- **Event hooks** throughout error lifecycle
|
|
91
|
-
- **Built-in examples**: Metrics tracking, Audit logging, Jira integration
|
|
92
|
-
- **Easy to create** custom plugins for any service
|
|
93
|
-
- **Safe execution** - plugin errors don't break the app
|
|
94
|
-
|
|
95
|
-
Common plugin use cases:
|
|
96
|
-
- ๐ Send metrics to StatsD, Datadog, Prometheus
|
|
97
|
-
- ๐ซ Create tickets in Jira, Linear, GitHub Issues
|
|
98
|
-
- ๐ Log audit trails for compliance
|
|
99
|
-
- ๐ข Send custom notifications
|
|
100
|
-
- ๐พ Archive errors to data warehouses
|
|
101
|
-
|
|
102
|
-
See [PLUGIN_SYSTEM_GUIDE.md](PLUGIN_SYSTEM_GUIDE.md) for detailed documentation.
|
|
103
|
-
|
|
104
|
-
### ๐๏ธ Architecture
|
|
105
|
-
Built with **Service Objects + CQRS Principles**:
|
|
106
|
-
- **Commands**: LogError, ResolveError, BatchResolveErrors, BatchDeleteErrors (write operations)
|
|
107
|
-
- **Queries**: ErrorsList, DashboardStats, AnalyticsStats (read operations)
|
|
108
|
-
- **Value Objects**: ErrorContext (immutable data)
|
|
109
|
-
- **Services**: PlatformDetector (business logic)
|
|
110
|
-
- **Plugins**: Extensible event-driven architecture
|
|
111
|
-
|
|
112
|
-
### โ
Multi-Version Testing
|
|
113
|
-
- **Rails Support**: 7.0, 7.1, 7.2, 8.0
|
|
114
|
-
- **Ruby Support**: 3.2, 3.3+
|
|
115
|
-
- **CI/CD**: 8 version combinations tested automatically
|
|
116
|
-
- **Compatibility**: 100% feature parity across all versions
|
|
117
|
-
|
|
118
|
-
See [MULTI_VERSION_TESTING.md](MULTI_VERSION_TESTING.md) for testing guide.
|
|
119
|
-
|
|
120
|
-
## ๐งช Implementation Status
|
|
121
|
-
|
|
122
|
-
### โ
Phase 1: Core Error Tracking (COMPLETE & TESTED)
|
|
123
|
-
- Error logging and deduplication
|
|
124
|
-
- Automatic tracking via middleware
|
|
125
|
-
- Controller/action context
|
|
126
|
-
- Request metadata capture
|
|
127
|
-
- User tracking
|
|
128
|
-
- Dashboard UI with search/filter
|
|
129
|
-
- Stack trace viewer
|
|
130
|
-
- Mark errors as resolved
|
|
131
|
-
- **Test Coverage**: 111 RSpec examples passing
|
|
132
|
-
|
|
133
|
-
### โ
Phase 2: Multi-Channel Notifications (COMPLETE)
|
|
134
|
-
- Slack integration
|
|
135
|
-
- Email notifications
|
|
136
|
-
- Discord webhooks
|
|
137
|
-
- PagerDuty integration
|
|
138
|
-
- Custom webhooks
|
|
139
|
-
- **Test Coverage**: Needs additional tests (functional but not extensively tested)
|
|
140
|
-
|
|
141
|
-
### โ
Phase 3: Batch Operations (COMPLETE)
|
|
142
|
-
- Bulk resolve errors
|
|
143
|
-
- Bulk delete errors
|
|
144
|
-
- API endpoints
|
|
145
|
-
- **Test Coverage**: Needs additional tests (functional but not extensively tested)
|
|
146
|
-
|
|
147
|
-
### โ
Phase 4: Analytics & Insights (COMPLETE)
|
|
148
|
-
- Error trends over time
|
|
149
|
-
- Platform breakdown
|
|
150
|
-
- Developer insights
|
|
151
|
-
- Dashboard statistics
|
|
152
|
-
- **Test Coverage**: Needs additional tests (functional but not extensively tested)
|
|
153
|
-
|
|
154
|
-
### โ
Phase 5: Plugin System (COMPLETE)
|
|
155
|
-
- Plugin architecture
|
|
156
|
-
- Event hooks
|
|
157
|
-
- Built-in plugins (Jira, Metrics, Audit Log)
|
|
158
|
-
- **Test Coverage**: Needs additional tests (functional but not extensively tested)
|
|
159
|
-
|
|
160
|
-
### ๐ What's Next
|
|
161
|
-
- Expand test coverage for Phases 2-5
|
|
162
|
-
- Real-world production testing
|
|
163
|
-
- Performance optimizations
|
|
164
|
-
- Additional integrations based on feedback
|
|
165
|
-
|
|
166
|
-
## ๐ฆ Installation
|
|
24
|
+
**Supports**: Rails 7.0 - 8.1 | Ruby 3.2+
|
|
167
25
|
|
|
168
|
-
|
|
26
|
+
---
|
|
169
27
|
|
|
170
|
-
|
|
171
|
-
gem 'rails_error_dashboard'
|
|
172
|
-
```
|
|
28
|
+
## ๐ฏ Who This Is For
|
|
173
29
|
|
|
174
|
-
|
|
30
|
+
โ **Solo bootstrappers** who need professional error tracking without recurring costs
|
|
175
31
|
|
|
176
|
-
|
|
177
|
-
bundle install
|
|
178
|
-
```
|
|
32
|
+
โ **Indie SaaS founders** building profitable apps on tight budgets
|
|
179
33
|
|
|
180
|
-
|
|
34
|
+
โ **Small dev teams** (2-5 people) who hate SaaS bloat
|
|
181
35
|
|
|
182
|
-
|
|
183
|
-
rails generate rails_error_dashboard:install
|
|
184
|
-
```
|
|
36
|
+
โ **Privacy-conscious apps** that need to keep error data on their own servers
|
|
185
37
|
|
|
186
|
-
|
|
187
|
-
- Create `config/initializers/rails_error_dashboard.rb`
|
|
188
|
-
- Copy migrations to your app
|
|
189
|
-
- Mount the engine at `/error_dashboard`
|
|
38
|
+
โ **Side projects** that might become real businesses
|
|
190
39
|
|
|
191
|
-
|
|
40
|
+
---
|
|
192
41
|
|
|
193
|
-
|
|
194
|
-
rails db:migrate
|
|
195
|
-
```
|
|
42
|
+
## ๐ฐ What It Replaces
|
|
196
43
|
|
|
197
|
-
|
|
44
|
+
| Before | After |
|
|
45
|
+
|--------|-------|
|
|
46
|
+
| Pay $29-99/month for error monitoring | $0/month - runs on your existing Rails server |
|
|
47
|
+
| Send sensitive error data to third parties | Keep all data on your infrastructure |
|
|
48
|
+
| Fight with SaaS pricing tiers and limits | Unlimited errors, unlimited projects |
|
|
49
|
+
| Vendor lock-in with proprietary APIs | 100% open source, fully portable |
|
|
50
|
+
| Complex setup with SDKs and external services | 5-minute Rails Engine installation |
|
|
198
51
|
|
|
199
|
-
|
|
52
|
+
---
|
|
200
53
|
|
|
201
|
-
|
|
202
|
-
# config/sidekiq.yml
|
|
203
|
-
:queues:
|
|
204
|
-
- error_notifications
|
|
205
|
-
- default
|
|
206
|
-
- mailers
|
|
207
|
-
```
|
|
54
|
+
## ๐ Why Choose Rails Error Dashboard
|
|
208
55
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
```yaml
|
|
212
|
-
# config/queue.yml
|
|
213
|
-
workers:
|
|
214
|
-
- queues: error_notifications
|
|
215
|
-
threads: 3
|
|
216
|
-
processes: 1
|
|
217
|
-
- queues: default
|
|
218
|
-
threads: 5
|
|
219
|
-
processes: 1
|
|
220
|
-
```
|
|
56
|
+
**"Install once, own it forever"**
|
|
221
57
|
|
|
222
|
-
|
|
58
|
+
- โ
**Zero recurring costs** - One-time setup, runs on your existing infrastructure
|
|
59
|
+
- โ
**5-minute installation** - Mount the Rails Engine, run migrations, done
|
|
60
|
+
- โ
**Works immediately** - Automatic error capture from Rails controllers, jobs, models
|
|
61
|
+
- โ
**Beautiful UI** - Professional dashboard you can show to clients
|
|
62
|
+
- โ
**Full control** - Your data stays on your server, modify anything you want
|
|
63
|
+
- โ
**No surprises** - Open source MIT license, no hidden fees or limits
|
|
223
64
|
|
|
224
|
-
|
|
65
|
+
**Built for developers who:**
|
|
66
|
+
- Want professional error monitoring without the SaaS tax
|
|
67
|
+
- Need to debug production issues without paying per error
|
|
68
|
+
- Value data privacy and server ownership
|
|
69
|
+
- Prefer simple, Rails-native solutions
|
|
225
70
|
|
|
226
|
-
|
|
227
|
-
```
|
|
228
|
-
http://localhost:3000/error_dashboard
|
|
229
|
-
```
|
|
71
|
+
---
|
|
230
72
|
|
|
231
|
-
|
|
232
|
-
- Username: `admin`
|
|
233
|
-
- Password: `password`
|
|
73
|
+

|
|
234
74
|
|
|
235
|
-
|
|
75
|
+
---
|
|
236
76
|
|
|
237
|
-
|
|
77
|
+
## โจ Features
|
|
238
78
|
|
|
239
|
-
|
|
240
|
-
RailsErrorDashboard.configure do |config|
|
|
241
|
-
# Dashboard authentication
|
|
242
|
-
config.dashboard_username = ENV.fetch('ERROR_DASHBOARD_USER', 'admin')
|
|
243
|
-
config.dashboard_password = ENV.fetch('ERROR_DASHBOARD_PASSWORD', 'password')
|
|
244
|
-
config.require_authentication = true
|
|
245
|
-
config.require_authentication_in_development = false
|
|
79
|
+
### Core Features (Always Enabled)
|
|
246
80
|
|
|
247
|
-
|
|
248
|
-
|
|
81
|
+
#### ๐ฏ Complete Error Tracking
|
|
82
|
+
Automatic error capture from Rails controllers, jobs, and middleware. Frontend & mobile support for React, React Native, Vue, Angular, Flutter. Platform detection (iOS/Android/Web/API), user context tracking, full stack traces.
|
|
249
83
|
|
|
250
|
-
|
|
84
|
+
#### ๐ Beautiful Dashboard
|
|
85
|
+
Modern Bootstrap 5 UI with dark/light mode, responsive design, real-time statistics, search and filtering, fast pagination. Overview dashboard with critical alerts, error trend charts, and platform health summary.
|
|
251
86
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
config.slack_webhook_url = ENV['SLACK_WEBHOOK_URL']
|
|
87
|
+
#### ๐ Analytics & Insights
|
|
88
|
+
7-day trend charts, severity breakdown, spike detection, resolution rate tracking, user impact analysis. Comprehensive analytics page with hourly patterns, mobile vs API breakdowns, and top affected users.
|
|
255
89
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
config.notification_email_recipients = ENV.fetch('ERROR_NOTIFICATION_EMAILS', '').split(',').map(&:strip)
|
|
259
|
-
config.notification_email_from = ENV.fetch('ERROR_NOTIFICATION_FROM', 'errors@example.com')
|
|
90
|
+
#### ๐ง Workflow Management
|
|
91
|
+
Error assignment and status tracking, priority levels (critical/high/medium/low), snooze functionality, comment threads, batch operations (bulk resolve/delete), resolution tracking with references.
|
|
260
92
|
|
|
261
|
-
|
|
262
|
-
|
|
93
|
+
#### ๐ Security & Privacy
|
|
94
|
+
HTTP Basic Auth, environment-based settings, optional separate database for isolation. Your data stays on your server - no third-party access.
|
|
263
95
|
|
|
264
|
-
|
|
265
|
-
config.use_separate_database = ENV.fetch('USE_SEPARATE_ERROR_DB', 'false') == 'true'
|
|
96
|
+
### Optional Features (Choose During Install)
|
|
266
97
|
|
|
267
|
-
|
|
268
|
-
config.retention_days = 90
|
|
98
|
+
#### ๐จ Multi-Channel Notifications
|
|
269
99
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
100
|
+
- **Slack** - Rich formatted messages with error context and direct dashboard links
|
|
101
|
+
- **Email** - HTML formatted alerts with full error details
|
|
102
|
+
- **Discord** - Embedded messages with severity color coding
|
|
103
|
+
- **PagerDuty** - Critical error escalation with incident management
|
|
104
|
+
- **Webhooks** - Custom integrations with any service (JSON payloads)
|
|
275
105
|
|
|
276
|
-
|
|
106
|
+
#### โก Performance Optimizations
|
|
277
107
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
108
|
+
- **Async Logging** - Non-blocking error capture using ActiveJob (Sidekiq/SolidQueue/Async)
|
|
109
|
+
- **Error Sampling** - Reduce storage by sampling high-frequency errors
|
|
110
|
+
- **Backtrace Limiting** - Save 70-90% storage with smart truncation
|
|
111
|
+
- **Separate Database** - Isolate error data for better performance
|
|
112
|
+
- **Database Indexes** - Composite indexes and PostgreSQL GIN full-text search
|
|
282
113
|
|
|
283
|
-
|
|
284
|
-
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
|
|
114
|
+
#### ๐ง Advanced Analytics (8 Powerful Features)
|
|
285
115
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
ERROR_NOTIFICATION_FROM=errors@myapp.com
|
|
116
|
+
**1. Baseline Anomaly Alerts** ๐
|
|
117
|
+
Automatically detect unusual error rate spikes using statistical analysis (mean + std dev). Get proactive notifications when errors exceed expected baselines with intelligent cooldown to avoid alert fatigue.
|
|
289
118
|
|
|
290
|
-
|
|
291
|
-
|
|
119
|
+
**2. Fuzzy Error Matching** ๐
|
|
120
|
+
Find similar errors across different error hashes using Jaccard similarity (70%) and Levenshtein distance (30%). Discover related errors that share common root causes even when they manifest differently.
|
|
292
121
|
|
|
293
|
-
|
|
294
|
-
|
|
122
|
+
**3. Co-occurring Errors** ๐
|
|
123
|
+
Detect errors that happen together within configurable time windows (default: 5 minutes). Identify patterns where one error frequently triggers another, helping you prioritize fixes.
|
|
295
124
|
|
|
296
|
-
|
|
125
|
+
**4. Error Cascade Detection** โ๏ธ
|
|
126
|
+
Identify error chains (A causes B causes C) with probability calculations and average delays. Visualize parentโchild relationships to understand cascading failures and fix root causes.
|
|
297
127
|
|
|
298
|
-
|
|
128
|
+
**5. Error Correlation Analysis** ๐
|
|
129
|
+
Correlate errors with app versions, git commits, and users. Find problematic releases, identify users affected by multiple error types, and detect time-based patterns.
|
|
299
130
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
- **Background jobs** (ActiveJob, Sidekiq)
|
|
303
|
-
- **Rack middleware** (catches everything else)
|
|
131
|
+
**6. Platform Comparison** ๐ฑ
|
|
132
|
+
Compare iOS vs Android vs Web health metrics side-by-side. Platform-specific error rates, severity distributions, resolution times, and stability scores (0-100).
|
|
304
133
|
|
|
305
|
-
|
|
134
|
+
**7. Occurrence Pattern Detection** ๐
|
|
135
|
+
Detect cyclical patterns (business hours, nighttime, weekend rhythms) and error bursts (many errors in short time). Understand when and how your errors happen.
|
|
306
136
|
|
|
307
|
-
|
|
137
|
+
**8. Developer Insights** ๐ก
|
|
138
|
+
AI-powered insights with severity detection, platform stability scoring, actionable recommendations, and recent error activity summaries.
|
|
139
|
+
|
|
140
|
+
#### ๐ Plugin System
|
|
141
|
+
Extensible architecture with event hooks (`on_error_logged`, `on_error_resolved`, `on_threshold_exceeded`). Built-in examples for Jira integration, metrics tracking, audit logging. Easy to create custom plugins - just drop a file in `config/initializers/error_dashboard_plugins/`.
|
|
142
|
+
|
|
143
|
+
**๐ [View complete feature list with examples โ](docs/FEATURES.md)**
|
|
144
|
+
|
|
145
|
+
---
|
|
308
146
|
|
|
309
|
-
|
|
147
|
+
## ๐ฆ Quick Start
|
|
148
|
+
|
|
149
|
+
### 1. Add to Gemfile
|
|
310
150
|
|
|
311
151
|
```ruby
|
|
312
|
-
|
|
313
|
-
# Your code
|
|
314
|
-
rescue => e
|
|
315
|
-
Rails.error.report(e,
|
|
316
|
-
handled: true,
|
|
317
|
-
severity: :error,
|
|
318
|
-
context: {
|
|
319
|
-
current_user: current_user,
|
|
320
|
-
custom_data: "anything you want"
|
|
321
|
-
}
|
|
322
|
-
)
|
|
323
|
-
end
|
|
152
|
+
gem 'rails_error_dashboard'
|
|
324
153
|
```
|
|
325
154
|
|
|
326
|
-
###
|
|
155
|
+
### 2. Install with Interactive Setup
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bundle install
|
|
159
|
+
rails generate rails_error_dashboard:install
|
|
160
|
+
rails db:migrate
|
|
161
|
+
```
|
|
327
162
|
|
|
328
|
-
|
|
163
|
+
The installer will guide you through optional feature selection:
|
|
164
|
+
- **Notifications** (Slack, Email, Discord, PagerDuty, Webhooks)
|
|
165
|
+
- **Performance** (Async Logging, Error Sampling, Separate Database)
|
|
166
|
+
- **Advanced Analytics** (8 powerful features including baseline alerts, fuzzy matching, platform comparison)
|
|
329
167
|
|
|
330
|
-
**
|
|
331
|
-
- ๐ฑ **React Native** (iOS & Android)
|
|
332
|
-
- โ๏ธ **React** (Web)
|
|
333
|
-
- ๐
ฐ๏ธ **Angular**
|
|
334
|
-
- ๐ **Vue.js**
|
|
335
|
-
- ๐ฑ **Flutter** (via HTTP)
|
|
336
|
-
- ๐ฑ **Swift/Kotlin** (Native apps)
|
|
337
|
-
- ๐ **Any JavaScript/TypeScript** application
|
|
168
|
+
**All features are opt-in** - choose what you need during installation, or enable/disable them later in the initializer.
|
|
338
169
|
|
|
339
|
-
|
|
170
|
+
This will:
|
|
171
|
+
- Create `config/initializers/rails_error_dashboard.rb` with your selected features
|
|
172
|
+
- Copy database migrations
|
|
173
|
+
- Mount the engine at `/error_dashboard`
|
|
340
174
|
|
|
341
|
-
|
|
175
|
+
### 3. Visit your dashboard
|
|
342
176
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
module V1
|
|
347
|
-
class MobileErrorsController < BaseController
|
|
348
|
-
def create
|
|
349
|
-
mobile_error = MobileError.new(error_params)
|
|
350
|
-
|
|
351
|
-
RailsErrorDashboard::Commands::LogError.call(
|
|
352
|
-
mobile_error,
|
|
353
|
-
{
|
|
354
|
-
current_user: current_user,
|
|
355
|
-
request: request,
|
|
356
|
-
source: :mobile_app # or :react, :vue, :angular, etc.
|
|
357
|
-
}
|
|
358
|
-
)
|
|
359
|
-
|
|
360
|
-
render json: { success: true }, status: :created
|
|
361
|
-
end
|
|
362
|
-
|
|
363
|
-
private
|
|
364
|
-
|
|
365
|
-
def error_params
|
|
366
|
-
params.require(:error).permit(:error_type, :message, :stack, :component)
|
|
367
|
-
end
|
|
368
|
-
|
|
369
|
-
class MobileError < StandardError
|
|
370
|
-
attr_reader :mobile_data
|
|
371
|
-
def initialize(data)
|
|
372
|
-
@mobile_data = data
|
|
373
|
-
super(data[:message])
|
|
374
|
-
end
|
|
375
|
-
def backtrace
|
|
376
|
-
@mobile_data[:stack]&.split("\n") || []
|
|
377
|
-
end
|
|
378
|
-
end
|
|
379
|
-
end
|
|
380
|
-
end
|
|
381
|
-
end
|
|
177
|
+
Start your server and visit:
|
|
178
|
+
```
|
|
179
|
+
http://localhost:3000/error_dashboard
|
|
382
180
|
```
|
|
383
181
|
|
|
384
|
-
**
|
|
182
|
+
**Default credentials:**
|
|
183
|
+
- Username: `gandalf`
|
|
184
|
+
- Password: `youshallnotpass`
|
|
385
185
|
|
|
386
|
-
|
|
387
|
-
// React/React Native/Vue/Angular
|
|
388
|
-
async function reportError(error, component) {
|
|
389
|
-
try {
|
|
390
|
-
await fetch('/api/v1/mobile_errors', {
|
|
391
|
-
method: 'POST',
|
|
392
|
-
headers: {
|
|
393
|
-
'Content-Type': 'application/json',
|
|
394
|
-
'Authorization': `Bearer ${authToken}`
|
|
395
|
-
},
|
|
396
|
-
body: JSON.stringify({
|
|
397
|
-
error: {
|
|
398
|
-
error_type: error.name,
|
|
399
|
-
message: error.message,
|
|
400
|
-
stack: error.stack,
|
|
401
|
-
component: component
|
|
402
|
-
}
|
|
403
|
-
})
|
|
404
|
-
});
|
|
405
|
-
} catch (e) {
|
|
406
|
-
console.error('Failed to report error:', e);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
186
|
+
โ ๏ธ **Change these before production!** Edit `config/initializers/rails_error_dashboard.rb`
|
|
409
187
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
188
|
+
### 4. Test it out
|
|
189
|
+
|
|
190
|
+
Trigger a test error to see it in action:
|
|
191
|
+
|
|
192
|
+
```ruby
|
|
193
|
+
# In Rails console or any controller
|
|
194
|
+
raise "Test error from Rails Error Dashboard!"
|
|
417
195
|
```
|
|
418
196
|
|
|
419
|
-
|
|
197
|
+
The error will appear instantly in your dashboard with full context, backtrace, and platform information.
|
|
420
198
|
|
|
421
|
-
|
|
422
|
-
class ErrorBoundary extends React.Component {
|
|
423
|
-
componentDidCatch(error, errorInfo) {
|
|
424
|
-
reportError(error, errorInfo.componentStack);
|
|
425
|
-
}
|
|
199
|
+
**๐ [Full installation guide โ](docs/QUICKSTART.md)**
|
|
426
200
|
|
|
427
|
-
|
|
428
|
-
return this.props.children;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
```
|
|
201
|
+
---
|
|
432
202
|
|
|
433
|
-
|
|
434
|
-
- โ
**Single dashboard** for all errors (backend + frontend + mobile)
|
|
435
|
-
- โ
**Platform detection** - errors automatically tagged by source
|
|
436
|
-
- โ
**User tracking** - errors associated with logged-in users
|
|
437
|
-
- โ
**Real-time notifications** - Slack/Email alerts for frontend errors too
|
|
438
|
-
- โ
**Component tracking** - know which component/screen errored
|
|
439
|
-
- โ
**Stack traces** - full JavaScript stack traces
|
|
203
|
+
## โ๏ธ Configuration
|
|
440
204
|
|
|
441
|
-
|
|
205
|
+
### Opt-in Feature System
|
|
442
206
|
|
|
443
|
-
|
|
444
|
-
- Offline support and retry logic
|
|
445
|
-
- Batch error reporting
|
|
446
|
-
- React Native integration
|
|
447
|
-
- Error filtering and deduplication
|
|
448
|
-
- Best practices
|
|
207
|
+
Rails Error Dashboard uses an **opt-in architecture** - core features (error capture, dashboard UI, analytics) are always enabled, while everything else is disabled by default.
|
|
449
208
|
|
|
450
|
-
|
|
209
|
+
**Tier 1 Features (Always ON)**:
|
|
210
|
+
- โ
Error capture (controllers, jobs, middleware)
|
|
211
|
+
- โ
Dashboard UI with search and filtering
|
|
212
|
+
- โ
Real-time updates
|
|
213
|
+
- โ
Analytics and trend charts
|
|
451
214
|
|
|
452
|
-
|
|
215
|
+
**Optional Features (Choose During Install)**:
|
|
216
|
+
- ๐ง Multi-channel notifications (Slack, Email, Discord, PagerDuty, Webhooks)
|
|
217
|
+
- โก Performance optimizations (Async logging, Error sampling)
|
|
218
|
+
- ๐ Advanced analytics (Baseline alerts, Fuzzy matching, Platform comparison, and more)
|
|
453
219
|
|
|
454
|
-
|
|
455
|
-
- **Overview**: Recent errors, statistics, quick filters
|
|
456
|
-
- **All Errors**: Paginated list with filtering and search
|
|
457
|
-
- **Analytics**: Charts, trends, and insights
|
|
458
|
-
- **Error Details**: Full stack trace, context, and resolution tracking
|
|
220
|
+
### Basic Configuration
|
|
459
221
|
|
|
460
|
-
|
|
222
|
+
Edit `config/initializers/rails_error_dashboard.rb`:
|
|
461
223
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
224
|
+
```ruby
|
|
225
|
+
RailsErrorDashboard.configure do |config|
|
|
226
|
+
# ============================================================================
|
|
227
|
+
# AUTHENTICATION (Always Required)
|
|
228
|
+
# ============================================================================
|
|
229
|
+
config.dashboard_username = ENV.fetch('ERROR_DASHBOARD_USER', 'gandalf')
|
|
230
|
+
config.dashboard_password = ENV.fetch('ERROR_DASHBOARD_PASSWORD', 'youshallnotpass')
|
|
469
231
|
|
|
470
|
-
|
|
232
|
+
# ============================================================================
|
|
233
|
+
# OPTIONAL FEATURES (Enable as needed)
|
|
234
|
+
# ============================================================================
|
|
471
235
|
|
|
472
|
-
|
|
236
|
+
# Slack notifications (if enabled during install)
|
|
237
|
+
config.enable_slack_notifications = true
|
|
238
|
+
config.slack_webhook_url = ENV['SLACK_WEBHOOK_URL']
|
|
473
239
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
- **Security isolation** - separate access controls
|
|
240
|
+
# Email notifications (if enabled during install)
|
|
241
|
+
config.enable_email_notifications = true
|
|
242
|
+
config.notification_email_recipients = ["dev@yourapp.com"]
|
|
243
|
+
config.notification_email_from = "errors@yourapp.com"
|
|
479
244
|
|
|
480
|
-
|
|
245
|
+
# Async logging for better performance (if enabled during install)
|
|
246
|
+
config.async_logging = true
|
|
247
|
+
config.async_adapter = :sidekiq # or :solid_queue, :async
|
|
481
248
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
config.
|
|
249
|
+
# Advanced analytics features (if enabled during install)
|
|
250
|
+
config.enable_baseline_alerts = true
|
|
251
|
+
config.enable_similar_errors = true
|
|
252
|
+
config.enable_platform_comparison = true
|
|
253
|
+
end
|
|
485
254
|
```
|
|
486
255
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
primary:
|
|
491
|
-
database: myapp_production
|
|
492
|
-
# ... your main DB config
|
|
493
|
-
|
|
494
|
-
error_logs:
|
|
495
|
-
database: myapp_error_logs_production
|
|
496
|
-
username: <%= ENV['ERROR_LOGS_DATABASE_USER'] %>
|
|
497
|
-
password: <%= ENV['ERROR_LOGS_DATABASE_PASSWORD'] %>
|
|
498
|
-
migrations_paths: db/error_logs_migrate
|
|
499
|
-
```
|
|
256
|
+
All features can be toggled on/off at any time by editing the initializer.
|
|
257
|
+
|
|
258
|
+
### Environment Variables
|
|
500
259
|
|
|
501
|
-
3. **Create and migrate**:
|
|
502
260
|
```bash
|
|
503
|
-
|
|
504
|
-
|
|
261
|
+
# .env
|
|
262
|
+
ERROR_DASHBOARD_USER=your_username
|
|
263
|
+
ERROR_DASHBOARD_PASSWORD=your_secure_password
|
|
264
|
+
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
|
|
265
|
+
DASHBOARD_BASE_URL=https://yourapp.com
|
|
505
266
|
```
|
|
506
267
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
If you already have error logs in your primary database and want to move them to the separate database:
|
|
268
|
+
**๐ [Complete configuration guide โ](docs/guides/CONFIGURATION.md)**
|
|
510
269
|
|
|
511
|
-
|
|
270
|
+
---
|
|
512
271
|
|
|
513
|
-
|
|
514
|
-
- Step-by-step migration process
|
|
515
|
-
- Data integrity verification
|
|
516
|
-
- Safe cleanup of old data
|
|
517
|
-
- Rollback procedures
|
|
518
|
-
- Performance considerations
|
|
519
|
-
- Troubleshooting common issues
|
|
272
|
+
## ๐ Usage
|
|
520
273
|
|
|
521
|
-
|
|
522
|
-
```bash
|
|
523
|
-
# 1. Configure separate database in database.yml
|
|
524
|
-
# 2. Create the new database
|
|
525
|
-
rails db:create:error_logs
|
|
526
|
-
rails db:migrate:error_logs
|
|
274
|
+
### Automatic Error Tracking
|
|
527
275
|
|
|
528
|
-
|
|
529
|
-
|
|
276
|
+
Rails Error Dashboard automatically tracks errors from:
|
|
277
|
+
- **Controllers** (via Rails error reporting)
|
|
278
|
+
- **Background jobs** (ActiveJob, Sidekiq)
|
|
279
|
+
- **Rack middleware** (catches everything else)
|
|
530
280
|
|
|
531
|
-
|
|
532
|
-
rake error_logs:verify_migration
|
|
281
|
+
No additional code needed! Just install and it works.
|
|
533
282
|
|
|
534
|
-
|
|
535
|
-
# 6. Clean up primary database
|
|
536
|
-
rake error_logs:cleanup_primary_db
|
|
537
|
-
```
|
|
283
|
+
### Manual Error Logging
|
|
538
284
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
### ๐ง Notification System
|
|
542
|
-
|
|
543
|
-
Rails Error Dashboard includes a powerful multi-channel notification system to alert your team when errors occur.
|
|
544
|
-
|
|
545
|
-
#### Slack Notifications
|
|
546
|
-
|
|
547
|
-
Get instant alerts in Slack with rich, formatted messages including:
|
|
548
|
-
- Error type and message
|
|
549
|
-
- Environment (Production, Staging, etc.)
|
|
550
|
-
- Platform (iOS, Android, API)
|
|
551
|
-
- User information
|
|
552
|
-
- Request details
|
|
553
|
-
- Direct link to view full error in dashboard
|
|
554
|
-
|
|
555
|
-
**Setup:**
|
|
556
|
-
|
|
557
|
-
1. Create a Slack webhook URL:
|
|
558
|
-
- Go to https://api.slack.com/messaging/webhooks
|
|
559
|
-
- Create a new webhook for your channel
|
|
560
|
-
- Copy the webhook URL
|
|
561
|
-
|
|
562
|
-
2. Configure in your app:
|
|
563
|
-
```bash
|
|
564
|
-
# .env
|
|
565
|
-
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
|
|
566
|
-
DASHBOARD_BASE_URL=https://myapp.com
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
3. Enable in initializer (enabled by default):
|
|
570
|
-
```ruby
|
|
571
|
-
config.enable_slack_notifications = true
|
|
572
|
-
config.slack_webhook_url = ENV['SLACK_WEBHOOK_URL']
|
|
573
|
-
```
|
|
574
|
-
|
|
575
|
-
**Slack Message Features:**
|
|
576
|
-
- ๐จ Beautifully formatted with color-coded blocks
|
|
577
|
-
- ๐ฑ Platform emoji indicators (iOS ๐ฑ, Android ๐ค, API ๐)
|
|
578
|
-
- ๐ค User and IP address tracking
|
|
579
|
-
- ๐ Direct "View Details" button linking to dashboard
|
|
580
|
-
- โฐ Timestamp with timezone
|
|
581
|
-
|
|
582
|
-
#### Email Notifications
|
|
583
|
-
|
|
584
|
-
Send detailed email alerts to your team with HTML and plain text versions.
|
|
585
|
-
|
|
586
|
-
**Email Features:**
|
|
587
|
-
- ๐จ Beautiful HTML email template with your app's branding
|
|
588
|
-
- ๐ Plain text fallback for email clients
|
|
589
|
-
- ๐ฏ Send to multiple recipients
|
|
590
|
-
- ๐ Full error context including stack trace
|
|
591
|
-
- ๐ One-click link to view in dashboard
|
|
592
|
-
- ๐ท๏ธ Environment and platform badges
|
|
593
|
-
|
|
594
|
-
**Setup:**
|
|
595
|
-
|
|
596
|
-
1. Configure recipients and sender:
|
|
597
|
-
```bash
|
|
598
|
-
# .env
|
|
599
|
-
ERROR_NOTIFICATION_EMAILS=dev-team@example.com,ops@example.com,alerts@example.com
|
|
600
|
-
ERROR_NOTIFICATION_FROM=errors@myapp.com
|
|
601
|
-
DASHBOARD_BASE_URL=https://myapp.com
|
|
602
|
-
```
|
|
603
|
-
|
|
604
|
-
2. Enable in initializer (enabled by default):
|
|
605
|
-
```ruby
|
|
606
|
-
config.enable_email_notifications = true
|
|
607
|
-
config.notification_email_recipients = ENV.fetch('ERROR_NOTIFICATION_EMAILS', '').split(',').map(&:strip)
|
|
608
|
-
config.notification_email_from = ENV.fetch('ERROR_NOTIFICATION_FROM', 'errors@example.com')
|
|
609
|
-
```
|
|
610
|
-
|
|
611
|
-
3. Ensure your Rails app has ActionMailer configured:
|
|
612
|
-
```ruby
|
|
613
|
-
# config/environments/production.rb
|
|
614
|
-
config.action_mailer.delivery_method = :smtp
|
|
615
|
-
config.action_mailer.smtp_settings = {
|
|
616
|
-
address: 'smtp.sendgrid.net',
|
|
617
|
-
port: 587,
|
|
618
|
-
domain: 'myapp.com',
|
|
619
|
-
user_name: ENV['SENDGRID_USERNAME'],
|
|
620
|
-
password: ENV['SENDGRID_PASSWORD'],
|
|
621
|
-
authentication: 'plain',
|
|
622
|
-
enable_starttls_auto: true
|
|
623
|
-
}
|
|
624
|
-
```
|
|
625
|
-
|
|
626
|
-
**Email Template Includes:**
|
|
627
|
-
- Error type and full message
|
|
628
|
-
- Environment badge (Production/Staging/Development)
|
|
629
|
-
- Platform badge (iOS/Android/API)
|
|
630
|
-
- Timestamp with timezone
|
|
631
|
-
- User email and IP address
|
|
632
|
-
- Request URL and parameters
|
|
633
|
-
- First 10 lines of stack trace
|
|
634
|
-
- Prominent "View Full Details" button
|
|
635
|
-
|
|
636
|
-
#### Disabling Notifications
|
|
637
|
-
|
|
638
|
-
You can selectively disable notifications:
|
|
285
|
+
For frontend/mobile apps or custom error logging:
|
|
639
286
|
|
|
640
287
|
```ruby
|
|
641
|
-
#
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
288
|
+
# From your Rails API
|
|
289
|
+
RailsErrorDashboard::Commands::LogError.call(
|
|
290
|
+
error_type: "TypeError",
|
|
291
|
+
message: "Cannot read property 'name' of null",
|
|
292
|
+
backtrace: ["App.js:42", "index.js:12"],
|
|
293
|
+
platform: "iOS",
|
|
294
|
+
app_version: "2.1.0",
|
|
295
|
+
user_id: current_user.id,
|
|
296
|
+
context: {
|
|
297
|
+
component: "ProfileScreen",
|
|
298
|
+
device_model: "iPhone 14 Pro"
|
|
299
|
+
}
|
|
300
|
+
)
|
|
650
301
|
```
|
|
651
302
|
|
|
652
|
-
|
|
303
|
+
### Frontend Integration
|
|
653
304
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
305
|
+
```javascript
|
|
306
|
+
// React Native example
|
|
307
|
+
try {
|
|
308
|
+
// Your code
|
|
309
|
+
} catch (error) {
|
|
310
|
+
fetch('https://yourapp.com/api/errors', {
|
|
311
|
+
method: 'POST',
|
|
312
|
+
headers: { 'Content-Type': 'application/json' },
|
|
313
|
+
body: JSON.stringify({
|
|
314
|
+
error_type: error.name,
|
|
315
|
+
message: error.message,
|
|
316
|
+
backtrace: error.stack.split('\n'),
|
|
317
|
+
platform: Platform.OS, // 'ios' or 'android'
|
|
318
|
+
app_version: VERSION
|
|
319
|
+
})
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
```
|
|
660
323
|
|
|
661
|
-
|
|
324
|
+
**๐ฑ [Mobile app integration guide โ](docs/guides/MOBILE_APP_INTEGRATION.md)**
|
|
662
325
|
|
|
663
|
-
|
|
664
|
-
- Prioritize error notifications over other jobs
|
|
665
|
-
- Monitor notification delivery separately
|
|
666
|
-
- Configure different concurrency/workers for notifications
|
|
326
|
+
---
|
|
667
327
|
|
|
668
|
-
|
|
669
|
-
- โ
**Solid Queue** (Rails 8.1+ default)
|
|
670
|
-
- โ
**Sidekiq** (most popular)
|
|
671
|
-
- โ
**Delayed Job**
|
|
672
|
-
- โ
**Resque**
|
|
673
|
-
- โ
**Async** (Rails default for development)
|
|
674
|
-
- โ
**Inline** (for testing)
|
|
328
|
+
## ๐ Notifications
|
|
675
329
|
|
|
676
|
-
|
|
330
|
+
Set up multi-channel notifications in minutes:
|
|
677
331
|
|
|
332
|
+
### Slack
|
|
678
333
|
```ruby
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
- default
|
|
682
|
-
- error_notifications # Add this queue
|
|
683
|
-
- mailers
|
|
684
|
-
|
|
685
|
-
# Optional: Higher priority for error notifications
|
|
686
|
-
:queues:
|
|
687
|
-
- [error_notifications, 5] # Process 5x more often
|
|
688
|
-
- [default, 1]
|
|
689
|
-
- [mailers, 1]
|
|
334
|
+
config.enable_slack_notifications = true
|
|
335
|
+
config.slack_webhook_url = ENV['SLACK_WEBHOOK_URL']
|
|
690
336
|
```
|
|
691
337
|
|
|
692
|
-
|
|
693
|
-
|
|
338
|
+
### Discord
|
|
694
339
|
```ruby
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
batch_size: 500
|
|
698
|
-
|
|
699
|
-
workers:
|
|
700
|
-
- queues: error_notifications
|
|
701
|
-
threads: 3
|
|
702
|
-
processes: 1
|
|
703
|
-
polling_interval: 1
|
|
704
|
-
- queues: default
|
|
705
|
-
threads: 5
|
|
706
|
-
processes: 1
|
|
707
|
-
polling_interval: 5
|
|
340
|
+
config.enable_discord_notifications = true
|
|
341
|
+
config.discord_webhook_url = ENV['DISCORD_WEBHOOK_URL']
|
|
708
342
|
```
|
|
709
343
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
**Background Jobs:**
|
|
716
|
-
- Notifications use `ActiveJob` and run in background
|
|
717
|
-
- Use dedicated `:error_notifications` queue
|
|
718
|
-
- Won't block or slow down your application
|
|
719
|
-
- Failed notifications are logged but don't raise errors
|
|
720
|
-
- Retries handled by your ActiveJob backend (Sidekiq, Solid Queue, etc.)
|
|
721
|
-
|
|
722
|
-
### Platform Detection
|
|
723
|
-
|
|
724
|
-
Automatically detects:
|
|
725
|
-
- **iOS** - iPhone, iPad apps
|
|
726
|
-
- **Android** - Android apps
|
|
727
|
-
- **API** - Backend services, web requests
|
|
728
|
-
|
|
729
|
-
### User Association
|
|
344
|
+
### PagerDuty (Critical Errors Only)
|
|
345
|
+
```ruby
|
|
346
|
+
config.enable_pagerduty_notifications = true
|
|
347
|
+
config.pagerduty_integration_key = ENV['PAGERDUTY_INTEGRATION_KEY']
|
|
348
|
+
```
|
|
730
349
|
|
|
731
|
-
|
|
350
|
+
### Custom Webhooks
|
|
351
|
+
```ruby
|
|
352
|
+
config.enable_webhook_notifications = true
|
|
353
|
+
config.webhook_urls = ['https://yourapp.com/hooks/errors']
|
|
354
|
+
```
|
|
732
355
|
|
|
733
|
-
|
|
356
|
+
**๐ [Notification setup guide โ](docs/guides/NOTIFICATIONS.md)**
|
|
734
357
|
|
|
735
|
-
|
|
358
|
+
---
|
|
736
359
|
|
|
737
|
-
##
|
|
360
|
+
## ๐ Documentation
|
|
738
361
|
|
|
739
|
-
###
|
|
362
|
+
### Getting Started
|
|
363
|
+
- **[Quickstart Guide](docs/QUICKSTART.md)** - Complete 5-minute setup
|
|
364
|
+
- **[Configuration](docs/guides/CONFIGURATION.md)** - All configuration options
|
|
365
|
+
- **[Mobile App Integration](docs/guides/MOBILE_APP_INTEGRATION.md)** - React Native, Flutter, etc.
|
|
740
366
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
367
|
+
### Features
|
|
368
|
+
- **[Complete Feature List](docs/FEATURES.md)** - Every feature explained
|
|
369
|
+
- **[Notifications](docs/guides/NOTIFICATIONS.md)** - Multi-channel alerting
|
|
370
|
+
- **[Batch Operations](docs/guides/BATCH_OPERATIONS.md)** - Bulk resolve/delete
|
|
371
|
+
- **[Real-Time Updates](docs/guides/REAL_TIME_UPDATES.md)** - Live dashboard
|
|
372
|
+
- **[Error Trend Visualizations](docs/guides/ERROR_TREND_VISUALIZATIONS.md)** - Charts & analytics
|
|
745
373
|
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
374
|
+
### Advanced
|
|
375
|
+
- **[Plugin System](docs/PLUGIN_SYSTEM.md)** - Build custom integrations
|
|
376
|
+
- **[API Reference](docs/API_REFERENCE.md)** - Complete API documentation
|
|
377
|
+
- **[Customization Guide](docs/CUSTOMIZATION.md)** - Customize everything
|
|
378
|
+
- **[Database Options](docs/guides/DATABASE_OPTIONS.md)** - Separate database setup
|
|
379
|
+
- **[Database Optimization](docs/guides/DATABASE_OPTIMIZATION.md)** - Performance tuning
|
|
749
380
|
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
# Get filtered errors
|
|
753
|
-
RailsErrorDashboard::Queries::ErrorsList.call(filters)
|
|
381
|
+
### Development
|
|
382
|
+
- **[Testing](docs/development/TESTING.md)** - Multi-version testing
|
|
754
383
|
|
|
755
|
-
|
|
756
|
-
RailsErrorDashboard::Queries::DashboardStats.call
|
|
384
|
+
**๐ [View all documentation โ](docs/README.md)**
|
|
757
385
|
|
|
758
|
-
|
|
759
|
-
RailsErrorDashboard::Queries::AnalyticsStats.call(days: 30)
|
|
760
|
-
```
|
|
386
|
+
---
|
|
761
387
|
|
|
762
|
-
|
|
388
|
+
## ๐๏ธ Architecture
|
|
763
389
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
# Context
|
|
772
|
-
t.integer :user_id
|
|
773
|
-
t.text :request_url
|
|
774
|
-
t.text :request_params
|
|
775
|
-
t.text :user_agent
|
|
776
|
-
t.string :ip_address
|
|
777
|
-
t.string :environment, null: false
|
|
778
|
-
t.string :platform
|
|
779
|
-
|
|
780
|
-
# Resolution tracking
|
|
781
|
-
t.boolean :resolved, default: false
|
|
782
|
-
t.text :resolution_comment
|
|
783
|
-
t.string :resolution_reference
|
|
784
|
-
t.string :resolved_by_name
|
|
785
|
-
t.datetime :resolved_at
|
|
786
|
-
|
|
787
|
-
# Timestamps
|
|
788
|
-
t.datetime :occurred_at, null: false
|
|
789
|
-
t.timestamps
|
|
790
|
-
end
|
|
791
|
-
```
|
|
390
|
+
Built with **Service Objects + CQRS Principles**:
|
|
391
|
+
- **Commands**: LogError, ResolveError, BatchOperations (write operations)
|
|
392
|
+
- **Queries**: ErrorsList, DashboardStats, Analytics (read operations)
|
|
393
|
+
- **Value Objects**: ErrorContext (immutable data)
|
|
394
|
+
- **Services**: PlatformDetector, SimilarityCalculator (business logic)
|
|
395
|
+
- **Plugins**: Event-driven extensibility
|
|
792
396
|
|
|
793
|
-
|
|
397
|
+
Clean, maintainable, testable architecture you can understand and modify.
|
|
794
398
|
|
|
795
|
-
|
|
796
|
-
- **[README.md](README.md)** - Main documentation (you are here!)
|
|
797
|
-
- **[NOTIFICATION_CONFIGURATION.md](NOTIFICATION_CONFIGURATION.md)** - Multi-channel notifications setup (Slack, Email, Discord, PagerDuty, Webhooks)
|
|
798
|
-
- **[MOBILE_APP_INTEGRATION.md](MOBILE_APP_INTEGRATION.md)** - Complete guide for integrating with React Native, Expo, and other mobile frameworks
|
|
799
|
-
- **[BATCH_OPERATIONS_GUIDE.md](BATCH_OPERATIONS_GUIDE.md)** - Bulk resolve/delete errors guide
|
|
800
|
-
- **[PLUGIN_DEVELOPMENT_GUIDE.md](PLUGIN_DEVELOPMENT_GUIDE.md)** - Create custom plugins for Jira, metrics, etc.
|
|
801
|
-
|
|
802
|
-
### Operations & Deployment
|
|
803
|
-
- **[MIGRATION_TO_SEPARATE_DATABASE.md](MIGRATION_TO_SEPARATE_DATABASE.md)** - Step-by-step guide for migrating to a separate error logs database
|
|
804
|
-
- **[MULTI_VERSION_TESTING.md](MULTI_VERSION_TESTING.md)** - Testing across Rails 7.0-8.0 and Ruby 3.2-3.3
|
|
805
|
-
- **[CI_TROUBLESHOOTING.md](CI_TROUBLESHOOTING.md)** - Complete guide to CI issues and solutions (for contributors)
|
|
806
|
-
|
|
807
|
-
### Topics Covered
|
|
808
|
-
- โ
Rails backend error tracking (automatic + manual)
|
|
809
|
-
- โ
Frontend/mobile error reporting (React, React Native, Vue, Angular, Flutter)
|
|
810
|
-
- โ
Multi-channel notifications (Slack, Email, Discord, PagerDuty, Webhooks)
|
|
811
|
-
- โ
Analytics and dashboard usage
|
|
812
|
-
- โ
Separate database setup and migration
|
|
813
|
-
- โ
Queue configuration (Sidekiq, Solid Queue, etc.)
|
|
814
|
-
- โ
Plugin system and custom integrations
|
|
815
|
-
- โ
Batch operations (bulk resolve/delete)
|
|
816
|
-
- โ
Multi-version compatibility (Rails 7.0-8.0, Ruby 3.2-3.3)
|
|
817
|
-
- โ
Security and authentication
|
|
818
|
-
- โ
Service Objects + CQRS architecture
|
|
399
|
+
---
|
|
819
400
|
|
|
820
401
|
## ๐ค Contributing
|
|
821
402
|
|
|
822
|
-
|
|
403
|
+
We welcome contributions! Here's how to get started:
|
|
823
404
|
|
|
824
405
|
1. Fork the repository
|
|
825
|
-
2. Create
|
|
826
|
-
3.
|
|
827
|
-
4.
|
|
828
|
-
5.
|
|
406
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
407
|
+
3. Write tests for your changes
|
|
408
|
+
4. Ensure all tests pass (`bundle exec rspec`)
|
|
409
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
410
|
+
6. Push to the branch (`git push origin feature/amazing-feature`)
|
|
411
|
+
7. Open a Pull Request
|
|
829
412
|
|
|
830
413
|
### Development Setup
|
|
831
414
|
|
|
832
415
|
```bash
|
|
833
416
|
git clone https://github.com/AnjanJ/rails_error_dashboard.git
|
|
834
417
|
cd rails_error_dashboard
|
|
418
|
+
|
|
419
|
+
# Automated setup (installs deps, hooks, runs tests)
|
|
420
|
+
bin/setup
|
|
421
|
+
|
|
422
|
+
# Or manual setup
|
|
835
423
|
bundle install
|
|
424
|
+
bundle exec lefthook install # Installs git hooks
|
|
425
|
+
bundle exec rspec
|
|
836
426
|
```
|
|
837
427
|
|
|
428
|
+
**Git Hooks:** We use [Lefthook](https://github.com/evilmartians/lefthook) to run quality checks before commit/push. This ensures CI passes and saves GitHub Actions minutes!
|
|
429
|
+
|
|
430
|
+
**๐ง [Development guide โ](DEVELOPMENT.md)** | **๐งช [Testing guide โ](docs/development/TESTING.md)**
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
838
434
|
## ๐ License
|
|
839
435
|
|
|
840
|
-
|
|
436
|
+
Rails Error Dashboard is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
437
|
+
|
|
438
|
+
---
|
|
841
439
|
|
|
842
440
|
## ๐ Acknowledgments
|
|
843
441
|
|
|
@@ -845,14 +443,18 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
845
443
|
- UI powered by [Bootstrap 5](https://getbootstrap.com/)
|
|
846
444
|
- Charts by [Chart.js](https://www.chartjs.org/)
|
|
847
445
|
- Pagination by [Pagy](https://github.com/ddnexus/pagy)
|
|
848
|
-
- Platform detection by [Browser](https://github.com/fnando/browser)
|
|
446
|
+
- Platform detection by [Browser gem](https://github.com/fnando/browser)
|
|
849
447
|
|
|
850
|
-
|
|
448
|
+
---
|
|
851
449
|
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
-
|
|
450
|
+
## ๐ฌ Support
|
|
451
|
+
|
|
452
|
+
- **๐ Documentation**: [docs/](docs/README.md)
|
|
453
|
+
- **๐ Issues**: [GitHub Issues](https://github.com/AnjanJ/rails_error_dashboard/issues)
|
|
454
|
+
- **๐ก Discussions**: [GitHub Discussions](https://github.com/AnjanJ/rails_error_dashboard/discussions)
|
|
855
455
|
|
|
856
456
|
---
|
|
857
457
|
|
|
858
458
|
**Made with โค๏ธ by Anjan for the Rails community**
|
|
459
|
+
|
|
460
|
+
*One Gem to rule them all, One Gem to find them, One Gem to bring them all, and in the dashboard bind them.* ๐งโโ๏ธ
|