Browse Source

Add Sentry monitoring to Rails parts

Maarten van den Berg 7 years ago
parent
commit
caf29f5c9e
4 changed files with 16 additions and 0 deletions
  1. 3 0
      .rbenv-vars-sample
  2. 3 0
      Gemfile
  3. 6 0
      Gemfile.lock
  4. 4 0
      app/helpers/authentication_helper.rb

+ 3 - 0
.rbenv-vars-sample

35
 
35
 
36
 # Do we bind to a socket or port?
36
 # Do we bind to a socket or port?
37
 PUMA_BIND=
37
 PUMA_BIND=
38
+
39
+# Set to enable Sentry reporting
40
+SENTRY_DSN=

+ 3 - 0
Gemfile

64
 gem 'delayed_job_active_record'
64
 gem 'delayed_job_active_record'
65
 gem 'daemons'
65
 gem 'daemons'
66
 
66
 
67
+# Error reporting
68
+gem 'sentry-raven'
69
+
67
 group :development, :test do
70
 group :development, :test do
68
   # Call 'byebug' anywhere in the code to stop execution and get a debugger console
71
   # Call 'byebug' anywhere in the code to stop execution and get a debugger console
69
   gem 'byebug', platform: :mri
72
   gem 'byebug', platform: :mri

+ 6 - 0
Gemfile.lock

75
     execjs (2.7.0)
75
     execjs (2.7.0)
76
     faker (1.7.3)
76
     faker (1.7.3)
77
       i18n (~> 0.5)
77
       i18n (~> 0.5)
78
+    faraday (0.14.0)
79
+      multipart-post (>= 1.2, < 3)
78
     ffi (1.9.18)
80
     ffi (1.9.18)
79
     font-awesome-sass (4.7.0)
81
     font-awesome-sass (4.7.0)
80
       sass (>= 3.2)
82
       sass (>= 3.2)
113
     mini_portile2 (2.1.0)
115
     mini_portile2 (2.1.0)
114
     minitest (5.10.1)
116
     minitest (5.10.1)
115
     multi_json (1.12.1)
117
     multi_json (1.12.1)
118
+    multipart-post (2.0.0)
116
     netrc (0.11.0)
119
     netrc (0.11.0)
117
     nio4r (2.0.0)
120
     nio4r (2.0.0)
118
     nokogiri (1.7.1)
121
     nokogiri (1.7.1)
163
       sprockets (>= 2.8, < 4.0)
166
       sprockets (>= 2.8, < 4.0)
164
       sprockets-rails (>= 2.0, < 4.0)
167
       sprockets-rails (>= 2.0, < 4.0)
165
       tilt (>= 1.1, < 3)
168
       tilt (>= 1.1, < 3)
169
+    sentry-raven (2.7.2)
170
+      faraday (>= 0.7.6, < 1.0)
166
     spring (2.0.1)
171
     spring (2.0.1)
167
       activesupport (>= 4.2)
172
       activesupport (>= 4.2)
168
     spring-watcher-listen (2.0.1)
173
     spring-watcher-listen (2.0.1)
231
   rabl
236
   rabl
232
   rails (~> 5.0.0, >= 5.0.0.1)
237
   rails (~> 5.0.0, >= 5.0.0.1)
233
   sass-rails (~> 5.0)
238
   sass-rails (~> 5.0)
239
+  sentry-raven
234
   spring
240
   spring
235
   spring-watcher-listen (~> 2.0.0)
241
   spring-watcher-listen (~> 2.0.0)
236
   sqlite3
242
   sqlite3

+ 4 - 0
app/helpers/authentication_helper.rb

123
       redirect_to controller: 'authentication', action: 'login_form'
123
       redirect_to controller: 'authentication', action: 'login_form'
124
       return false
124
       return false
125
     end
125
     end
126
+
127
+    Raven.user_context(
128
+      user_firstname: current_person.first_name
129
+    )
126
     return true
130
     return true
127
   end
131
   end
128
 
132