summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-04-20 19:52:27 +0000
committerRobert Speicher <robert@gitlab.com>2016-04-20 19:52:27 +0000
commit0f309794e78243b1ee16ba6f1451dbb0752956c5 (patch)
tree7e3588951ee09746973d2583fd2b890fa0e3a2f7 /app
parent1e596fef1c42a1dd925636c48fea01be444dc3ab (diff)
parent3e7a8b0789745080e499f68862ff29e3bc178453 (diff)
downloadgitlab-ce-0f309794e78243b1ee16ba6f1451dbb0752956c5.tar.gz
Merge branch 'sentry-js' into 'master'
Add Sentry logging for JavaScript errors Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/12675 See merge request !3795
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/application.js.coffee1
-rw-r--r--app/assets/javascripts/raven_config.js.coffee44
2 files changed, 45 insertions, 0 deletions
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 5bac8eef1cb..642e7429acf 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -55,6 +55,7 @@
#= require_tree .
#= require fuzzaldrin-plus
#= require cropper
+#= require raven
window.slugify = (text) ->
text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase()
diff --git a/app/assets/javascripts/raven_config.js.coffee b/app/assets/javascripts/raven_config.js.coffee
new file mode 100644
index 00000000000..d031a655abf
--- /dev/null
+++ b/app/assets/javascripts/raven_config.js.coffee
@@ -0,0 +1,44 @@
+@raven =
+ init: ->
+ if gon.sentry_dsn?
+ Raven.config(gon.sentry_dsn, {
+ includePaths: [/gon.relative_url_root/]
+ ignoreErrors: [
+ # Random plugins/extensions
+ 'top.GLOBALS',
+ # See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html
+ 'originalCreateNotification',
+ 'canvas.contentDocument',
+ 'MyApp_RemoveAllHighlights',
+ 'http://tt.epicplay.com',
+ 'Can\'t find variable: ZiteReader',
+ 'jigsaw is not defined',
+ 'ComboSearch is not defined',
+ 'http://loading.retry.widdit.com/',
+ 'atomicFindClose',
+ # ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
+ # reduce this. (thanks @acdha)
+ # See http://stackoverflow.com/questions/4113268
+ 'bmi_SafeAddOnload',
+ 'EBCallBackMessageReceived',
+ # See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
+ 'conduitPage'
+ ],
+ ignoreUrls: [
+ # Chrome extensions
+ /extensions\//i,
+ /^chrome:\/\//i,
+ # Other plugins
+ /127\.0\.0\.1:4001\/isrunning/i, # Cacaoweb
+ /webappstoolbarba\.texthelp\.com\//i,
+ /metrics\.itunes\.apple\.com\.edgesuite\.net\//i
+ ]
+ }).install()
+
+ if gon.current_user_id
+ Raven.setUserContext({
+ id: gon.current_user_id
+ })
+
+$ ->
+ raven.init()