summaryrefslogtreecommitdiff
path: root/config/initializers/sentry.rb
diff options
context:
space:
mode:
authorJeroen Nijhof <jeroen@jeroennijhof.nl>2016-01-18 17:15:10 +0100
committerJeroen Nijhof <jeroen@jeroennijhof.nl>2016-01-18 17:15:10 +0100
commit85e0fce9eee4f20c6c627209828f7351ab0aedae (patch)
treebe370c396b49d7be4d96ccaf48d4bca2592e4ab7 /config/initializers/sentry.rb
parentf603f3b30bcd4303f07f87a0c6fa60697b2775fd (diff)
downloadgitlab-ce-85e0fce9eee4f20c6c627209828f7351ab0aedae.tar.gz
Add sentry integration
Diffstat (limited to 'config/initializers/sentry.rb')
-rw-r--r--config/initializers/sentry.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb
new file mode 100644
index 00000000000..3ef46291981
--- /dev/null
+++ b/config/initializers/sentry.rb
@@ -0,0 +1,17 @@
+# Be sure to restart your server when you modify this file.
+
+require 'gitlab/current_settings'
+include Gitlab::CurrentSettings
+
+# allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done
+begin
+ sentry_enabled = current_application_settings.sentry_enabled
+rescue
+ sentry_enabled = false
+end
+
+if sentry_enabled
+ Raven.configure do |config|
+ config.dsn = current_application_settings.sentry_dsn
+ end
+end